diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-27 09:16:20 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-27 09:16:20 +0000 |
| commit | e21f706bbd8c4fec757fbb65835b0e00e683400d (patch) | |
| tree | 49ef99e2eb178bd48e8ca50db077267c13f1b3c5 /gc.c | |
| parent | b154c9488ec0e660ac4ebe7e14bede39f064d731 (diff) | |
| download | ruby-e21f706bbd8c4fec757fbb65835b0e00e683400d.tar.gz ruby-e21f706bbd8c4fec757fbb65835b0e00e683400d.tar.xz ruby-e21f706bbd8c4fec757fbb65835b0e00e683400d.zip | |
* gc.c (gc_sweep): recover ruby_in_compile variable.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
| -rw-r--r-- | gc.c | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -179,6 +179,7 @@ ruby_xfree(x) RUBY_CRITICAL(free(x)); } +extern int ruby_in_compile; static int dont_gc; static int during_gc; static int need_call_final = 0; @@ -1034,6 +1035,19 @@ gc_sweep() int i; unsigned long live = 0; + if (ruby_in_compile && ruby_parser_stack_on_heap()) { + /* should not reclaim nodes during compilation + if yacc's semantic stack is not allocated on machine stack */ + for (i = 0; i < heaps_used; i++) { + p = heaps[i].slot; pend = p + heaps[i].limit; + while (p < pend) { + if (!(p->as.basic.flags&FL_MARK) && BUILTIN_TYPE(p) == T_NODE) + gc_mark((VALUE)p, 0); + p++; + } + } + } + mark_source_filename(ruby_sourcefile); st_foreach(source_filenames, sweep_source_filename, 0); @@ -1426,10 +1440,10 @@ rb_gc_start() void ruby_set_stack_size(size) - size_t *size; + size_t size; { #ifndef STACK_LEVEL_MAX - STACK_LEVEL_MAX = size; + STACK_LEVEL_MAX = size / sizeof(VALUE); #endif } |
