1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

use ALLOC_N instead of malloc

This commit is contained in:
ser1zw 2012-08-30 17:12:15 +09:00
parent b63e197680
commit 14b1d0073e

View file

@ -115,7 +115,7 @@ hash_to_format_specific_param(VALUE hash)
};
const int flag_size = sizeof(flags) / sizeof(int);
int* params = (int*)malloc(sizeof(int) * RHASH_SIZE(hash) * 2);
int* params = (int*)ALLOC_N(int, RHASH_SIZE(hash) * 2);
for (int i = 0, n = 0; i < flag_size; i++) {
VALUE val = rb_hash_lookup(hash, INT2FIX(flags[i]));
if (!NIL_P(val)) {