summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-27 09:49:34 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-27 09:49:34 +0000
commit77e876615da5f1482b225bd4f754b9fefcd52cec (patch)
tree27bc06133685cb3d4bcb75cfc81b3cda6cdf8e04 /gc.c
parentf0ba57341ac7815189f7e33c980b8cbb51571efb (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/gc.c b/gc.c
index 8c7169e..d7d7c26 100644
--- a/gc.c
+++ b/gc.c
@@ -284,8 +284,7 @@ rb_newobj()
freelist = freelist->as.free.next;
return obj;
}
- if (dont_gc || during_gc || rb_prohibit_interrupt) add_heap();
- else rb_gc();
+ rb_gc();
goto retry;
}
@@ -661,18 +660,6 @@ gc_sweep()
int freed = 0;
int i, used = heaps_used;
- if (ruby_in_compile) {
- /* sould not reclaim nodes during compilation */
- for (i = 0; i < used; i++) {
- p = heaps[i]; pend = p + HEAP_SLOTS;
- while (p < pend) {
- if (!(p->as.basic.flags&FL_MARK) && BUILTIN_TYPE(p) == T_NODE)
- rb_gc_mark(p);
- p++;
- }
- }
- }
-
freelist = 0;
final_list = 0;
for (i = 0; i < used; i++) {
@@ -913,6 +900,11 @@ rb_gc()
# define STACK_END (stack_end)
#endif
+ if (dont_gc || during_gc || rb_prohibit_interrupt || ruby_in_compile) {
+ add_heap();
+ return;
+ }
+
malloc_memories = 0;
if (during_gc) return;