summaryrefslogtreecommitdiff
path: root/gcj_mlc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-03-15 10:10:39 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-03-15 10:10:39 +0300
commitd6ccabe90f203f4789e1bc5ee98b8bd7c1b82361 (patch)
tree643c3b015d453c68d677f3b5f290afb2fc6f8c6c /gcj_mlc.c
parentf282bb3502896b6740375465619c405e30780196 (diff)
downloadbdwgc-d6ccabe90f203f4789e1bc5ee98b8bd7c1b82361.tar.gz
Fix the collector hang when it is configured with --enable-gc-debug
Issue #205 (bdwgc). * dbg_mlc.c (GC_store_debug_info_inner): Remove comment (as it exists in the header); change from STATIC to GC_INNER. * dbg_mlc.c (STORE_DEBUG_INFO): New macro. * dbg_mlc.c (GC_store_debug_info): Change from GC_INNER to static; remove GC_ prefix; replace ptr_t to void*; add fn argument; replace "const char *string, int linenum" with GC_EXTRA_PARAMS; change "word sz" argument to "size_t lb"; allow p to be null (print error message in this case); call GC_start_debugging_inner unless GC_debugging_started; call ADD_CALL_CHAIN. * dbg_mlc.c (GC_start_debugging): Remove. * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_generic_malloc, GC_debug_malloc_atomic, GC_debug_malloc_uncollectable): Call STORE_DEBUG_INFO() instead of checking result for null and calling GC_start_debugging, ADD_CALL_CHAIN, GC_store_debug_info. * dbg_mlc.c [STUBBORN_ALLOC] (GC_debug_malloc_stubborn): Likewise. * dbg_mlc.c [GC_ATOMIC_UNCOLLECTABLE] (GC_debug_malloc_atomic_uncollectable): Likewise. * gcj_mlc.c [GC_GCJ_SUPPORT] (GC_debug_gcj_malloc): Call ADD_CALL_CHAIN while holding the lock; call GC_store_debug_info_inner (holding the lock) instead of GC_store_debug_info. * include/private/dbg_mlc.h (ADD_CALL_CHAIN): Update comment. * include/private/gc_priv.h (GC_store_debug_info): Replace with GC_store_debug_info_inner; update comment; change ptr_t to void*. * os_dep.c [SAVE_CALL_CHAIN] (GC_save_callers): Add assertion that the allocation lock is held; add comment.
Diffstat (limited to 'gcj_mlc.c')
-rw-r--r--gcj_mlc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcj_mlc.c b/gcj_mlc.c
index 55af7a03..35b3d3f1 100644
--- a/gcj_mlc.c
+++ b/gcj_mlc.c
@@ -223,9 +223,10 @@ GC_API GC_ATTR_MALLOC void * GC_CALL GC_debug_gcj_malloc(size_t lb,
if (!GC_debugging_started) {
GC_start_debugging_inner();
}
- UNLOCK();
ADD_CALL_CHAIN(result, ra);
- return GC_store_debug_info((ptr_t)result, (word)lb, s, i);
+ result = GC_store_debug_info_inner(result, (word)lb, s, i);
+ UNLOCK();
+ return result;
}
/* There is no THREAD_LOCAL_ALLOC for GC_gcj_malloc_ignore_off_page(). */