Refactoring of GC_Xobjfreelist
authorAlessandro Bruni <alessandro.bruni@gmail.com>
Tue, 5 Jan 2016 07:51:52 +0000 (10:51 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 5 Jan 2016 07:51:52 +0000 (10:51 +0300)
commit41871b970c8fd9704835c1a221a8f9f1deea707a
treed1e2fe604ec12921a6eb204fe2b9033fad7b0d8e
parent7fecb024d35db637937e6194c7e7255713be82b7
Refactoring of GC_Xobjfreelist
(use single array to keep free lists of all kinds)

* alloc.c: Update comment (replace GC_objfreelist with
GC_freelists[NORMAL]).
* checksums.c (GC_on_free_list): Replace GC_sobjfreelist with
GC_freelists[STUBBORN].
* mark.c (GC_obj_kinds): Likewise.
* include/private/gc_priv.h (PTRFREE, NORMAL, UNCOLLECTABLE,
AUNCOLLECTABLE, STUBBORN, IS_UNCOLLECTABLE): Move definition upper to
be before _GC_arrays declaration.
* include/private/gc_priv.h (PREDEFINED_KINDS): New macro.
* include/private/gc_priv.h (GC_freelists): New macro (of global
variable if SEPARATE_GLOBALS).
* include/private/gc_priv.h (_GC_arrays): Replace _objfreelist,
_aobjfreelist, _uobjfreelist, _auobjfreelist, _sobjfreelist fields
with single _freelists[] field.
* include/private/gc_priv.h (GC_objfreelist, GC_aobjfreelist,
GC_auobjfreelist, GC_sobjfreelist, GC_uobjfreelist,
beginGC_objfreelist, endGC_objfreelist, beginGC_aobjfreelist,
endGC_aobjfreelist): Remove macro.
* include/private/gc_priv.h (GC_objfreelist, GC_aobjfreelist): Replace
variable declarations with single GC_freelists[] one (if
SEPARATE_GLOBALS).
* malloc.c (GC_malloc_atomic): Replace GC_aobjfreelist with
GC_freelists[PTRFREE].
* mallocx.c (GC_aobjfreelist_ptr): Likewise.
* mark.c (GC_obj_kinds): Likewise.
* thread_local_alloc.c (GC_destroy_thread_local): Likewise.
* malloc.c (GC_malloc): Replace GC_objfreelist with
GC_freelists[NORMAL].
* mallocx.c (GC_objfreelist_ptr): Likewise.
* mark.c (GC_obj_kinds): Likewise.
* thread_local_alloc.c (GC_destroy_thread_local): Likewise.
* malloc.c (GC_malloc_uncollectable): Replace GC_uobjfreelist with
GC_freelists[UNCOLLECTABLE].
* mallocx.c (GC_uobjfreelist_ptr): Likewise.
* mark.c (GC_obj_kinds): Likewise.
* mallocx.c (GC_auobjfreelist_ptr, GC_malloc_atomic_uncollectable):
Replace GC_auobjfreelist with GC_freelists[AUNCOLLECTABLE].
* mark.c (GC_obj_kinds): Likewise.
* misc.c (GC_init): Exclude whole GC_freelists from scanning instead
of beginGC_objfreelist and beginGC_aobjfreelist (if SEPARATE_GLOBALS).
alloc.c
checksums.c
include/private/gc_priv.h
malloc.c
mallocx.c
mark.c
misc.c
thread_local_alloc.c