1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (gc_sweep): re-introduce heap extension strategy change.

[ruby-dev:31005]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-06-16 12:39:35 +00:00
parent 8092d0bd87
commit c4d2965fb6
2 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Sat Jun 16 21:37:43 2007 Tanaka Akira <akr@fsij.org>
* gc.c (gc_sweep): re-introduce heap extension strategy change.
[ruby-dev:31005]
Fri Jun 15 22:59:37 2007 Tanaka Akira <akr@fsij.org>
* .gdbinit: new file to ease debugging using gdb.
@ -8,6 +13,7 @@ Fri Jun 15 22:33:55 2007 Tanaka Akira <akr@fsij.org>
(trap_handler): support SYSTEM_DEFAULT. call default_handler
internally.
(sig_trap): don't call default_handler.
[ruby-dev:30999]
Fri Jun 15 22:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
@ -19,6 +25,7 @@ Fri Jun 15 20:50:02 2007 Tanaka Akira <akr@fsij.org>
* keywords: enclose C code in declaration section by %{ and %} to
avoid extra semicolon after #ifdef RIPPER.
pointed by eban.
Fri Jun 15 18:56:52 2007 Tanaka Akira <akr@fsij.org>

12
gc.c
View file

@ -1109,6 +1109,14 @@ gc_sweep(void)
int freed = 0;
int i;
unsigned long live = 0;
unsigned long free_min = 0;
for (i = 0; i < heaps_used; i++) {
free_min += heaps[i].limit;
}
free_min = free_min * 0.2;
if (free_min < FREE_MIN)
free_min = FREE_MIN;
mark_source_filename(ruby_sourcefile);
if (source_filenames) {
@ -1151,7 +1159,7 @@ gc_sweep(void)
}
p++;
}
if (n == heaps[i].limit && freed > FREE_MIN) {
if (n == heaps[i].limit && freed > free_min) {
RVALUE *pp;
heaps[i].limit = 0;
@ -1169,7 +1177,7 @@ gc_sweep(void)
if (malloc_limit < GC_MALLOC_LIMIT) malloc_limit = GC_MALLOC_LIMIT;
}
malloc_increase = 0;
if (freed < FREE_MIN) {
if (freed < free_min) {
add_heap();
}
during_gc = 0;