mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
gc.c: drop special case for big hash/array
* gc.c (rb_gc_writebarrier): drop special case for big hash/array [Bug #9518] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c501345218
commit
1d2d053bda
2 changed files with 8 additions and 14 deletions
|
@ -1,3 +1,8 @@
|
|||
Sun Apr 20 06:01:18 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* gc.c (rb_gc_writebarrier): drop special case for big hash/array
|
||||
[Bug #9518]
|
||||
|
||||
Sat Apr 19 15:38:29 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (primary): flush cmdarg flags inside left-paren in a
|
||||
|
|
17
gc.c
17
gc.c
|
@ -4789,20 +4789,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue