about summary refs log tree commit
path: root/ext/rpatricia/patricia.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/rpatricia/patricia.c')
-rw-r--r--ext/rpatricia/patricia.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/rpatricia/patricia.c b/ext/rpatricia/patricia.c
index d211a34..7fc3d27 100644
--- a/ext/rpatricia/patricia.c
+++ b/ext/rpatricia/patricia.c
@@ -31,7 +31,13 @@ static char copyright[] =
 
 #include "patricia.h"
 
-#define Delete free
+#if defined(HAVE_RUBY_XCALLOC)
+#  include <ruby.h>
+#  define calloc xcalloc
+#  define Delete xfree
+#else
+#  define Delete free
+#endif
 
 /* { from prefix.c */