summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-05 09:01:07 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-05 09:01:07 +0000
commit656d6d28704943d2960b20761b6d05386086e8a2 (patch)
treec99fec4f83ee9eb51430be6aaec27682c7dc6367 /gc.c
parent7f3aa8b9ea9aaf38f4167e95ba86dd5d3766554e (diff)
2000-06-05
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c44
1 files changed, 38 insertions, 6 deletions
diff --git a/gc.c b/gc.c
index e54639eca4..cb53573a77 100644
--- a/gc.c
+++ b/gc.c
@@ -51,9 +51,8 @@ static unsigned long alloc_objects = 0;
static int malloc_called = 0;
-#ifndef xmalloc
void *
-xmalloc(size)
+ruby_xmalloc(size)
size_t size;
{
void *mem;
@@ -79,7 +78,7 @@ xmalloc(size)
}
void *
-xcalloc(n, size)
+ruby_xcalloc(n, size)
size_t n, size;
{
void *mem;
@@ -91,7 +90,7 @@ xcalloc(n, size)
}
void *
-xrealloc(ptr, size)
+ruby_xrealloc(ptr, size)
void *ptr;
size_t size;
{
@@ -115,12 +114,11 @@ xrealloc(ptr, size)
}
void
-xfree(x)
+ruby_xfree(x)
void *x;
{
if (x) free(x);
}
-#endif
/* The way of garbage collecting which allows use of the cstack is due to */
/* Scheme In One Defun, but in C this time.
@@ -1203,3 +1201,37 @@ Init_GC()
rb_global_variable(&finalizers);
finalizers = rb_ary_new();
}
+
+#undef xmalloc
+#undef xcalloc
+#undef xrealloc
+#undef xfree
+
+void*
+xmalloc(size)
+ size_t size;
+{
+ return ruby_xmalloc(size);
+}
+
+void*
+xcalloc(n,size)
+ size_t n,size;
+{
+ return ruby_xcalloc(n, size);
+}
+
+void*
+xrealloc(ptr,size)
+ void *ptr;
+ size_t size;
+{
+ return ruby_xrealloc(ptr, size);
+}
+
+void
+xfree(ptr)
+ void *ptr;
+{
+ ruby_xfree(ptr);
+}