summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-01 23:12:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-01 23:12:06 +0000
commit239cf26854a54ebb430b561628e77ed5be375ad9 (patch)
tree64eb15af4d05399a0a7546ab486aa55c357d7c51 /gc.c
parent1a81d2e1e915e6e44df05544c30ffab400f32b67 (diff)
downloadruby-239cf26854a54ebb430b561628e77ed5be375ad9.tar.gz
ruby-239cf26854a54ebb430b561628e77ed5be375ad9.tar.xz
ruby-239cf26854a54ebb430b561628e77ed5be375ad9.zip
* gc.c (add_heap): heap_slots may overflow. a patch from Stefan
Weil <weil at mail.berlios.de>. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index e5ab3523f..a77f962fc 100644
--- a/gc.c
+++ b/gc.c
@@ -363,6 +363,7 @@ add_heap()
if (himem < pend) himem = pend;
heaps_used++;
heap_slots *= 1.8;
+ if (heap_slots <= 0) heap_slots = HEAP_MIN_SLOTS;
while (p < pend) {
p->as.free.flags = 0;