Skip to content
Browse files

ext/libcdb/ruby_cdb.h: Use Ruby's xfree.

Plus, we only need to allocate one struct.
  • Loading branch information...
1 parent 677d96c commit 10df3c4ca840cc18da35368a1d395cf5657dbb26 @blackwinter committed Jan 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 ext/libcdb/ruby_cdb.h
View
4 ext/libcdb/ruby_cdb.h
@@ -18,12 +18,12 @@
#define RCDB_DEFINE_ALLOC(what, _struct) \
static void \
rcdb_##what##er_free(void *ptr) {\
- free(ptr);\
+ xfree(ptr);\
}\
\
static VALUE \
rcdb_##what##er_alloc(VALUE klass) {\
- struct _struct *ptr = ALLOC_N(struct _struct, 1);\
+ struct _struct *ptr = ALLOC(struct _struct);\
return Data_Wrap_Struct(klass, NULL, rcdb_##what##er_free, ptr);\
}

0 comments on commit 10df3c4

Please sign in to comment.
Something went wrong with that request. Please try again.