mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
modified CvMemStorage
This commit is contained in:
parent
a9b92b2239
commit
7c752a17ab
2 changed files with 4 additions and 5 deletions
|
@ -36,18 +36,17 @@ define_ruby_class()
|
||||||
*/
|
*/
|
||||||
VALUE opencv = rb_module_opencv();
|
VALUE opencv = rb_module_opencv();
|
||||||
rb_klass = rb_define_class_under(opencv, "CvMemStorage", rb_cObject);
|
rb_klass = rb_define_class_under(opencv, "CvMemStorage", rb_cObject);
|
||||||
//rb_define_method(rb_klass, "initialize", RUBY_METHOD_FUNC(rb_initialize), -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_allocate(VALUE klass)
|
rb_allocate(VALUE klass)
|
||||||
{
|
{
|
||||||
CvMemStorage *storage = cvCreateMemStorage();
|
CvMemStorage *storage = cvCreateMemStorage();
|
||||||
return Data_Wrap_Struct(klass, 0, free, storage);
|
return Data_Wrap_Struct(klass, 0, cvmemstorage_free, storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
free(void *ptr)
|
cvmemstorage_free(void *ptr)
|
||||||
{
|
{
|
||||||
cvReleaseMemStorage((CvMemStorage**)&ptr);
|
cvReleaseMemStorage((CvMemStorage**)&ptr);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +55,7 @@ VALUE
|
||||||
new_object(int blocksize)
|
new_object(int blocksize)
|
||||||
{
|
{
|
||||||
CvMemStorage *storage = cvCreateMemStorage(blocksize);
|
CvMemStorage *storage = cvCreateMemStorage(blocksize);
|
||||||
return Data_Wrap_Struct(rb_klass, 0, free, storage);
|
return Data_Wrap_Struct(rb_klass, 0, cvmemstorage_free, storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ void define_ruby_class();
|
||||||
|
|
||||||
VALUE rb_class();
|
VALUE rb_class();
|
||||||
VALUE rb_allocate(VALUE klass);
|
VALUE rb_allocate(VALUE klass);
|
||||||
void free(void *ptr);
|
void cvmemstorage_free(void *ptr);
|
||||||
|
|
||||||
VALUE new_object(int blocksize = 0);
|
VALUE new_object(int blocksize = 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue