summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-12-23 12:53:34 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-12-23 12:53:34 +0400
commitd4cbed4d93167a0b4907abd237ff234007fae59a (patch)
tree8dc27363b0b31deb252524433f8416a3fb196fc3 /mark.c
parent1b5b1b71cea18fca2e9a9990f8684c0b10e35286 (diff)
downloadbdwgc-d4cbed4d93167a0b4907abd237ff234007fae59a.tar.gz
Fix GC_print_trace missing unlock
* mark.c (GC_print_trace): Perform UNLOCK (if "lock" is on) before return (inside loop).
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mark.c b/mark.c
index 9d03ccde..8ef7c575 100644
--- a/mark.c
+++ b/mark.c
@@ -1463,7 +1463,10 @@ void GC_print_trace(word gc_no, GC_bool lock)
for (i = GC_trace_buf_ptr-1; i != GC_trace_buf_ptr; i--) {
if (i < 0) i = TRACE_ENTRIES-1;
p = GC_trace_buf + i;
- if (p -> gc_no < gc_no || p -> kind == 0) return;
+ if (p -> gc_no < gc_no || p -> kind == 0) {
+ if (lock) UNLOCK();
+ return;
+ }
printf("Trace:%s (gc:%u,bytes:%lu) 0x%X, 0x%X\n",
p -> kind, (unsigned)p -> gc_no,
(unsigned long)p -> bytes_allocd,