summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-01-18 09:53:51 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-01-18 09:53:51 +0300
commitc97fdcc2e9eb445d65916a519dc53f82f5059f0f (patch)
tree0135eefd57d12366a51be0512637b9f807aaf7d1 /mark.c
parent742febb2f662a45b69bc0c5faef2111d576694fd (diff)
downloadbdwgc-c97fdcc2e9eb445d65916a519dc53f82f5059f0f.tar.gz
Fix assertions in alloc_mark_stack and gww_dirty_init for GWW_VDB
(fix of commit f2a2e55e4) * include/private/gc_priv.h [MPROTECT_VDB && GWW_VDB] (GC_gww_dirty_init): Explicitly note that the caller may or may not hold the lock. * mark.c [GWW_VDB] (alloc_mark_stack): Move recycle_old and GC_incremental_at_stack_alloc local variable declarations to precede GC_ASSERT(). * mark.c [!GWW_VDB] (alloc_mark_stack): Do not define recycle_old. * os_dep.c [GWW_VDB] (GC_gww_dirty_init): Remove assertion about the lock; add comment.
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mark.c b/mark.c
index 2027a0dd..861c06e0 100644
--- a/mark.c
+++ b/mark.c
@@ -1240,6 +1240,11 @@ GC_INNER void GC_help_marker(word my_mark_no)
/* May silently fail. */
static void alloc_mark_stack(size_t n)
{
+# ifdef GWW_VDB
+ static GC_bool GC_incremental_at_stack_alloc = FALSE;
+
+ GC_bool recycle_old;
+# endif
mse * new_stack;
GC_ASSERT(I_HOLD_LOCK());
@@ -1247,19 +1252,17 @@ static void alloc_mark_stack(size_t n)
# ifdef GWW_VDB
/* Don't recycle a stack segment obtained with the wrong flags. */
/* Win32 GetWriteWatch requires the right kind of memory. */
- static GC_bool GC_incremental_at_stack_alloc = FALSE;
- GC_bool recycle_old = !GC_auto_incremental
- || GC_incremental_at_stack_alloc;
-
+ recycle_old = !GC_auto_incremental || GC_incremental_at_stack_alloc;
GC_incremental_at_stack_alloc = GC_auto_incremental;
-# else
-# define recycle_old TRUE
# endif
GC_mark_stack_too_small = FALSE;
if (GC_mark_stack != NULL) {
if (new_stack != 0) {
- if (recycle_old) {
+# ifdef GWW_VDB
+ if (recycle_old)
+# endif
+ {
/* Recycle old space. */
GC_scratch_recycle_inner(GC_mark_stack,
GC_mark_stack_size * sizeof(struct GC_ms_entry));