Skip to content

Commit af8afd6

Browse files
authored
fixes multithread marking (#1240)
Multithreaded marking wasn’t working because the following preprocessor block was never executed (at least when compiling with MSVC): #if (MAX_GC_THREADS>1) // You can uncomment this for better call stacks if it crashes while collecting #define HX_MULTI_THREAD_MARKING #endif
1 parent a428509 commit af8afd6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/hx/gc/Immix.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,13 @@ static bool sGcVerifyGenerational = false;
198198
#else
199199
enum { MAX_GC_THREADS = 2 };
200200
#endif
201+
202+
// You can uncomment this for better call stacks if it crashes while collecting
203+
#define HX_MULTI_THREAD_MARKING
201204
#else
202205
enum { MAX_GC_THREADS = 1 };
203206
#endif
204207

205-
#if (MAX_GC_THREADS>1)
206-
// You can uncomment this for better call stacks if it crashes while collecting
207-
#define HX_MULTI_THREAD_MARKING
208-
#endif
209-
210208
#ifdef PROFILE_THREAD_USAGE
211209
static int sThreadMarkCountData[MAX_GC_THREADS+1];
212210
static int sThreadArrayMarkCountData[MAX_GC_THREADS+1];
@@ -1952,7 +1950,7 @@ class MarkContext
19521950
if (obj)
19531951
{
19541952
obj->__Mark(this);
1955-
#if HX_MULTI_THREAD_MARKING
1953+
#ifdef HX_MULTI_THREAD_MARKING
19561954
// Load balance
19571955
if (sLazyThreads && marking->count>32)
19581956
{

0 commit comments

Comments
 (0)