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

implemented rb_cvAlloc and replaced cvAlloc with rb_cvAlloc to allocate memory buffer as much as possible

This commit is contained in:
ser1zw 2011-04-28 00:11:46 +09:00
parent 196c567ee0
commit 586f2161eb
6 changed files with 94 additions and 29 deletions

View file

@ -333,7 +333,7 @@ rb_seq_push(VALUE self, VALUE args, int flag)
cvSeqPush(seq, DATA_PTR(object));
}
else if (rb_obj_is_kind_of(object, rb_klass) && CLASS_OF(rb_first(object)) == klass) { // object is CvSeq
buffer = cvCvtSeqToArray(CVSEQ(object), cvAlloc(CVSEQ(object)->total * CVSEQ(object)->elem_size));
buffer = cvCvtSeqToArray(CVSEQ(object), rb_cvAlloc(CVSEQ(object)->total * CVSEQ(object)->elem_size));
cvSeqPushMulti(seq, buffer, CVSEQ(object)->total, flag);
cvFree(&buffer);
}