diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-07-21 01:26:58 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-07-21 01:26:58 +0300 |
commit | 0ce1a71ec28c4d07dba09c5f32e4937708492cf2 (patch) | |
tree | 70a529d92565c475d24534c3cfa54c314a4eeb56 /thread_local_alloc.c | |
parent | 098457839dcb6c935d0aa18c6459c800d4c646b2 (diff) | |
download | bdwgc-0ce1a71ec28c4d07dba09c5f32e4937708492cf2.tar.gz |
Re-implement GC_finalized_malloc using GC_malloc_kind
(code refactoring)
* fnlz_mlc.c: Do not test THREAD_LOCAL_ALLOC; do not include
thread_local_alloc.h.
* fnlz_mlc.c (GC_finalized_objfreelist, GC_core_finalized_malloc):
Remove.
* fnlz_mlc.c [ENABLE_DISCLAIM]: Include gc_inline.h (to declare
GC_malloc_kind).
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_init_finalized_malloc): Do not use
GC_finalized_objfreelist.
* fnlz_mlc.c [ENABLE_DISCLAIM] (GC_finalized_malloc): Call
GC_malloc_kind (instead of own implementation mostly duplicating the
algorithm of GC_malloc_kind[_global]); change type of "op" local
variable from ptr_t to word*.
* include/private/thread_local_alloc.h [ENABLE_DISCLAIM]
(THREAD_FREELISTS_KINDS): Increase value by 1.
* include/private/thread_local_alloc.h
(thread_local_freelists.finalized_freelists,
GC_finalized_objfreelist): Remove.
* thread_local_alloc.c (GC_finalized_objfreelist): Remove.
* thread_local_alloc.c (GC_init_thread_local, GC_destroy_thread_local,
GC_mark_thread_local_fls_for, GC_check_tls_for): Do not access
finalized_freelists.
Diffstat (limited to 'thread_local_alloc.c')
-rw-r--r-- | thread_local_alloc.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/thread_local_alloc.c b/thread_local_alloc.c index 1e000794..951a5df2 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -32,12 +32,6 @@ GC_key_t GC_thread_key; static GC_bool keys_initialized; -#ifdef ENABLE_DISCLAIM - GC_INNER ptr_t * GC_finalized_objfreelist = NULL; - /* This variable is declared here to prevent linking of */ - /* fnlz_mlc module unless the client uses the latter one. */ -#endif - /* Return a single nonempty freelist fl to the global one pointed to */ /* by gfl. */ @@ -119,9 +113,6 @@ GC_INNER void GC_init_thread_local(GC_tlfs p) # ifdef GC_GCJ_SUPPORT p -> gcj_freelists[j] = (void *)(word)1; # endif -# ifdef ENABLE_DISCLAIM - p -> finalized_freelists[j] = (void *)(word)1; -# endif } /* The size 0 free lists are handled like the regular free lists, */ /* to ensure that the explicit deallocation works. However, */ @@ -147,10 +138,6 @@ GC_INNER void GC_destroy_thread_local(GC_tlfs p) # ifdef GC_GCJ_SUPPORT return_freelists(p -> gcj_freelists, (void **)GC_gcjobjfreelist); # endif -# ifdef ENABLE_DISCLAIM - return_freelists(p -> finalized_freelists, - (void **)GC_finalized_objfreelist); -# endif } #ifdef GC_ASSERTIONS @@ -290,11 +277,6 @@ GC_INNER void GC_mark_thread_local_fls_for(GC_tlfs p) GC_set_fl_marks(q); } # endif -# ifdef ENABLE_DISCLAIM - q = p -> finalized_freelists[j]; - if ((word)q > HBLKSIZE) - GC_set_fl_marks(q); -# endif } } @@ -311,9 +293,6 @@ GC_INNER void GC_mark_thread_local_fls_for(GC_tlfs p) # ifdef GC_GCJ_SUPPORT GC_check_fl_marks(&p->gcj_freelists[j]); # endif -# ifdef ENABLE_DISCLAIM - GC_check_fl_marks(&p->finalized_freelists[j]); -# endif } } #endif /* GC_ASSERTIONS */ |