summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1994-12-08 14:17:29 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:30 +0900
commit00e36aa09f54925c2f9c30524b48f4f54a9adb23 (patch)
tree57bf15576109b53406796c66b29d5e11d9fd99c0 /gc.c
parent4dfd93c72a9a221c5575c5888483f2fb55c82117 (diff)
version 0.60v0_60
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.60.tar.gz Thu Dec 8 14:17:29 1994 Yukihiro Matsumoto (matz@ix-02) * 0.60 released - alpha test baseline.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/gc.c b/gc.c
index 0dcaae7..5c1d27e 100644
--- a/gc.c
+++ b/gc.c
@@ -3,7 +3,7 @@
gc.c -
$Author: matz $
- $Date: 1994/11/01 08:27:58 $
+ $Date: 1994/12/06 09:30:02 $
created at: Tue Oct 5 09:44:46 JST 1993
Copyright (C) 1994 Yukihiro Matsumoto
@@ -110,7 +110,7 @@ Cambridge, MA 02138
static int dont_gc;
VALUE
-Fgc_enable()
+Sgc_enable()
{
int old = dont_gc;
@@ -119,7 +119,7 @@ Fgc_enable()
}
VALUE
-Fgc_disable()
+Sgc_disable()
{
int old = dont_gc;
@@ -130,12 +130,14 @@ Fgc_disable()
#include <sys/types.h>
#include <sys/times.h>
-static Fgc_begin()
+static
+Fgc_begin()
{
return Qnil;
}
-static Fgc_end()
+static
+Fgc_end()
{
return Qnil;
}
@@ -234,14 +236,19 @@ newobj()
}
VALUE
-newdata(size)
- UINT size;
+data_new(datap, dfree, dmark)
+ VALUE *datap;
+ void (*dfree)();
+ void (*dmark)();
{
extern VALUE C_Data;
struct RData *data = (struct RData*)newobj();
OBJSETUP(data, C_Data, T_DATA);
- data->data = xmalloc(size);
+ data->data = datap;
+ data->dfree = dfree;
+ data->dmark = dmark;
+
return (VALUE)data;
}
@@ -445,6 +452,8 @@ gc_mark(obj)
#define MIN_FREE_OBJ 512
+static void obj_free();
+
static void
gc_sweep()
{
@@ -509,6 +518,7 @@ freemethod(key, body)
return ST_CONTINUE;
}
+static void
obj_free(obj)
struct RBasic *obj;
{
@@ -632,7 +642,7 @@ Init_GC()
{
M_GC = rb_define_module("GC");
rb_define_single_method(M_GC, "start", gc, 0);
- rb_define_single_method(M_GC, "enable", Fgc_enable, 0);
- rb_define_single_method(M_GC, "disable", Fgc_disable, 0);
+ rb_define_single_method(M_GC, "enable", Sgc_enable, 0);
+ rb_define_single_method(M_GC, "disable", Sgc_disable, 0);
rb_define_method(M_GC, "garbage_collect", gc, 0);
}