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:
parent
b63e197680
commit
14b1d0073e
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ hash_to_format_specific_param(VALUE hash)
|
||||||
};
|
};
|
||||||
const int flag_size = sizeof(flags) / sizeof(int);
|
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++) {
|
for (int i = 0, n = 0; i < flag_size; i++) {
|
||||||
VALUE val = rb_hash_lookup(hash, INT2FIX(flags[i]));
|
VALUE val = rb_hash_lookup(hash, INT2FIX(flags[i]));
|
||||||
if (!NIL_P(val)) {
|
if (!NIL_P(val)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue