From 40849ff1bc881009459e686e53f82656d0c9df27 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 29 Mar 2014 05:57:55 +0000 Subject: gc.c (rb_gc_writebarrier): remove special case for large hash/array Magic size threshold should not be used to infer lifetime behavior, users may use large arrays and hashes for queueing and caching. [Bug #9518] --- gc.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/gc.c b/gc.c index 3b9721e9d3..fc55e89fff 100644 --- a/gc.c +++ b/gc.c @@ -4744,20 +4744,9 @@ rb_gc_writebarrier(VALUE a, VALUE b) rb_objspace_t *objspace = &rb_objspace; if (!rgengc_remembered(objspace, a)) { - int type = BUILTIN_TYPE(a); - /* TODO: 2 << 16 is just a magic number. */ - if ((type == T_ARRAY && RARRAY_LEN(a) >= 2 << 16) || - (type == T_HASH && RHASH_SIZE(a) >= 2 << 16)) { - if (!rgengc_remembered(objspace, b)) { - rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n", (void *)a, obj_type_name(a), (void *)b, obj_type_name(b)); - rgengc_remember(objspace, b); - } - } - else { - rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n", - (void *)a, obj_type_name(a), (void *)b, obj_type_name(b)); - rgengc_remember(objspace, a); - } + rgengc_report(2, objspace, "rb_gc_wb: %p (%s) -> %p (%s)\n", + (void *)a, obj_type_name(a), (void *)b, obj_type_name(b)); + rgengc_remember(objspace, a); } } } -- cgit v1.2.3-24-ge0c7