diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gc.c | 7 | ||||
-rw-r--r-- | yarvcore.c | 8 | ||||
-rw-r--r-- | yarvcore.h | 2 |
4 files changed, 18 insertions, 5 deletions
@@ -1,3 +1,9 @@ +Thu May 24 11:46:55 2007 Koichi Sasada <ko1@atdot.net> + + * gc.c, yarvcore.c: fix to mark VM structure on startup. + + * yarvcore.h: disable USE_CACHED_VALUE. + Thu May 24 01:54:53 2007 Koichi Sasada <ko1@atdot.net> * cont.c: support callcc which everyone love. @@ -504,7 +504,7 @@ rb_fill_value_cache(rb_thread_t *th) VALUE rb_newobj(void) { -#if USE_VALUE_CACHE && 1 +#if USE_VALUE_CACHE rb_thread_t *th = GET_THREAD(); VALUE v = *th->value_cache_ptr; @@ -1333,6 +1333,8 @@ int rb_setjmp (rb_jmp_buf); #define GC_NOTIFY 0 +void rb_vm_mark(void *ptr); + static int garbage_collect(void) { @@ -1358,8 +1360,7 @@ garbage_collect(void) init_mark_stack(); - rb_gc_mark(th->vm->self); - rb_gc_mark(th->vm->mark_object_ary); + th->vm->self ? rb_gc_mark(th->vm->self) : rb_vm_mark(th->vm); if (finalizer_table) { mark_tbl(finalizer_table, 0); diff --git a/yarvcore.c b/yarvcore.c index 21346f909e..b266bf6957 100644 --- a/yarvcore.c +++ b/yarvcore.c @@ -12,7 +12,6 @@ #include "ruby.h" #include "node.h" - #include "yarvcore.h" #include "gc.h" @@ -192,6 +191,7 @@ vm_mark(void *ptr) MARK_UNLESS_NULL(vm->mark_object_ary); MARK_UNLESS_NULL(vm->last_status); MARK_UNLESS_NULL(vm->loaded_features); + if (vm->loading_table) { rb_mark_tbl(vm->loading_table); } @@ -202,6 +202,12 @@ vm_mark(void *ptr) MARK_REPORT_LEAVE("vm"); } +void +rb_vm_mark(void *ptr) +{ + vm_mark(ptr); +} + static VALUE vm_alloc(VALUE klass) { diff --git a/yarvcore.h b/yarvcore.h index 61bd53764b..181e86d34e 100644 --- a/yarvcore.h +++ b/yarvcore.h @@ -411,7 +411,7 @@ struct rb_vm_tag { }; #define RUBY_VM_VALUE_CACHE_SIZE 0x1000 -#define USE_VALUE_CACHE 1 +#define USE_VALUE_CACHE 0 struct rb_thread_struct { |