summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-03 01:01:12 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-11-03 01:01:12 +0000
commitf6b2490fdb7d30d0c4ab37d63801f969c1aad4d5 (patch)
treecea218f64e6479efd64a3e21332bc4d7f492f7e7 /gc.c
parent2d189f672b21968ef9dbd27a2bddcfea146595c1 (diff)
* gc.c, vm.c, vm_core.h: remove USE_VALUE_CACHE option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c62
1 files changed, 7 insertions, 55 deletions
diff --git a/gc.c b/gc.c
index a26a1965a2..a0f8527c88 100644
--- a/gc.c
+++ b/gc.c
@@ -1034,6 +1034,13 @@ heaps_increment(rb_objspace_t *objspace)
return FALSE;
}
+int
+rb_during_gc(void)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return during_gc;
+}
+
#define RANY(o) ((RVALUE*)(o))
static VALUE
@@ -1061,49 +1068,10 @@ rb_newobj_from_heap(rb_objspace_t *objspace)
return obj;
}
-#if USE_VALUE_CACHE
-static VALUE
-rb_fill_value_cache(rb_thread_t *th)
-{
- rb_objspace_t *objspace = &rb_objspace;
- int i;
- VALUE rv;
-
- /* LOCK */
- for (i=0; i<RUBY_VM_VALUE_CACHE_SIZE; i++) {
- VALUE v = rb_newobj_from_heap(objspace);
-
- th->value_cache[i] = v;
- RBASIC(v)->flags = FL_MARK;
- }
- th->value_cache_ptr = &th->value_cache[0];
- rv = rb_newobj_from_heap(objspace);
- /* UNLOCK */
- return rv;
-}
-#endif
-
-int
-rb_during_gc(void)
-{
- rb_objspace_t *objspace = &rb_objspace;
- return during_gc;
-}
-
VALUE
rb_newobj(void)
{
-#if USE_VALUE_CACHE || (defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE)
- rb_thread_t *th = GET_THREAD();
-#endif
-#if USE_VALUE_CACHE
- VALUE v = *th->value_cache_ptr;
-#endif
-#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
- rb_objspace_t *objspace = th->vm->objspace;
-#else
rb_objspace_t *objspace = &rb_objspace;
-#endif
if (during_gc) {
dont_gc = 1;
@@ -1111,23 +1079,7 @@ rb_newobj(void)
rb_bug("object allocation during garbage collection phase");
}
-#if USE_VALUE_CACHE
- if (v) {
- RBASIC(v)->flags = 0;
- th->value_cache_ptr++;
- }
- else {
- v = rb_fill_value_cache(th);
- }
-
-#if defined(GC_DEBUG)
- printf("cache index: %d, v: %p, th: %p\n",
- th->value_cache_ptr - th->value_cache, v, th);
-#endif
- return v;
-#else
return rb_newobj_from_heap(objspace);
-#endif
}
NODE*