summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--gc.c13
-rw-r--r--vm.c2
3 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 59a7d33..751f40e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Sun Jul 6 13:37:27 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c (rb_gc_register_mark_object): change data structure.
+ From single array, to array of arrays. Each array only has 1024
+ entries.
+
+ * vm.c (Init_vm_objects): change default capa from 1 to 128.
+
Sat Jul 5 05:05:53 2014 Vipul A M <vipulnsward@gmail.com>
* lib/irb/locale.rb (IRB::Locale#modifier): fix wrong attr_reader
diff --git a/gc.c b/gc.c
index 661f100..13df413 100644
--- a/gc.c
+++ b/gc.c
@@ -5119,10 +5119,21 @@ rb_gc_force_recycle(VALUE p)
*/
}
+#ifndef MARK_OBJECT_ARY_BUCKET_SIZE
+#define MARK_OBJECT_ARY_BUCKET_SIZE 1024
+#endif
+
void
rb_gc_register_mark_object(VALUE obj)
{
- VALUE ary = GET_THREAD()->vm->mark_object_ary;
+ VALUE ary_ary = GET_THREAD()->vm->mark_object_ary;
+ VALUE ary = rb_ary_last(0, 0, ary_ary);
+
+ if (ary == Qnil || RARRAY_LEN(ary) >= MARK_OBJECT_ARY_BUCKET_SIZE) {
+ ary = rb_ary_tmp_new(MARK_OBJECT_ARY_BUCKET_SIZE);
+ rb_ary_push(ary_ary, ary);
+ }
+
rb_ary_push(ary, obj);
}
diff --git a/vm.c b/vm.c
index 32beb34..0fd5e3f 100644
--- a/vm.c
+++ b/vm.c
@@ -2793,7 +2793,7 @@ Init_vm_objects(void)
vm->defined_module_hash = rb_hash_new();
/* initialize mark object array, hash */
- vm->mark_object_ary = rb_ary_tmp_new(1);
+ vm->mark_object_ary = rb_ary_tmp_new(128);
}
/* top self */