* gc.c: fix layout of rb_objsapce_t to improve cache locality.

newobj_of() accesses:
  (1) rb_objspace_t::flags
  (2) rb_objspace_t::eden_heap::freelist
  (3) and rb_objspace_t::eden_heap::free_pages if freelist is NULL.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2014-09-09 05:24:42 +00:00
Родитель 3238a4a729
Коммит 15e4903cba
2 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,12 @@
Tue Sep 9 14:21:50 2014 Koichi Sasada <ko1@atdot.net>
* gc.c: fix layout of rb_objsapce_t to improve cache locality.
newobj_of() accesses:
(1) rb_objspace_t::flags
(2) rb_objspace_t::eden_heap::freelist
(3) and rb_objspace_t::eden_heap::free_pages if freelist is NULL.
Tue Sep 9 14:09:36 2014 Koichi Sasada <ko1@atdot.net>
* gc.c: move rb_objspace_t::flags::gc_stressfull after during_gc

11
gc.c
Просмотреть файл

@ -435,13 +435,14 @@ typedef struct mark_stack {
} mark_stack_t;
typedef struct rb_heap_struct {
struct heap_page *pages;
RVALUE *freelist;
struct heap_page *free_pages;
struct heap_page *using_page;
struct heap_page *pages;
struct heap_page *sweep_pages;
struct heap_page *pooled_pages;
RVALUE *freelist;
size_t page_length; /* total page count in a heap */
size_t total_slots; /* total slot count (page_length * HEAP_OBJ_LIMIT) */
} rb_heap_t;
@ -477,15 +478,15 @@ typedef struct rb_objspace {
#endif
} flags;
rb_heap_t eden_heap;
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
struct {
rb_atomic_t finalizing;
} atomic_flags;
size_t marked_objects;
rb_heap_t eden_heap;
rb_heap_t tomb_heap; /* heap for zombies and ghosts */
struct {
struct heap_page **sorted;
size_t used;