merge revision(s) 39644,39646,39647,39874,39898: [Backport #8048]

* load.c (features_index_add_single, rb_feature_p): store single index
	  as Fixnum to reduce the number of arrays for the indexes.  based on
	  the patch by tmm1 (Aman Gupta) in [ruby-core:53216] [Bug #8048].

	* load.c (rb_feature_p), vm_core.h (rb_vm_struct): turn
	  loaded_features_index into st_table.  patches by tmm1 (Aman Gupta)
	  in [ruby-core:53251] and [ruby-core:53274] [Bug #8048]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2013-04-20 15:13:50 +00:00
parent 80ecaa1777
commit c1ca05af16
5 changed files with 77 additions and 25 deletions

4
vm.c
View file

@ -1565,7 +1565,6 @@ rb_vm_mark(void *ptr)
RUBY_MARK_UNLESS_NULL(vm->expanded_load_path);
RUBY_MARK_UNLESS_NULL(vm->loaded_features);
RUBY_MARK_UNLESS_NULL(vm->loaded_features_snapshot);
RUBY_MARK_UNLESS_NULL(vm->loaded_features_index);
RUBY_MARK_UNLESS_NULL(vm->top_self);
RUBY_MARK_UNLESS_NULL(vm->coverages);
rb_gc_mark_locations(vm->special_exceptions, vm->special_exceptions + ruby_special_error_count);
@ -1573,6 +1572,9 @@ rb_vm_mark(void *ptr)
if (vm->loading_table) {
rb_mark_tbl(vm->loading_table);
}
if (vm->loaded_features_index) {
rb_mark_tbl(vm->loaded_features_index);
}
vm_trace_mark_event_hooks(&vm->event_hooks);