From 656d6d28704943d2960b20761b6d05386086e8a2 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 5 Jun 2000 09:01:07 +0000 Subject: 2000-06-05 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) (limited to 'gc.c') 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); +} -- cgit v1.2.3