Skip to content

Commit 2422f59

Browse files
committed
Add Emscripten-specific threading configuration and refactor memory allocation
- Disabled multithreading for Emscripten/WASM builds. - Simplified `TaskGroup` allocation logic. NP-1250
1 parent 3288882 commit 2422f59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/xatlas.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ Copyright (c) 2012 Brandon Pelfrey
6262
#endif
6363

6464
#ifndef XA_MULTITHREADED
65+
#ifdef __EMSCRIPTEN__
66+
#define XA_MULTITHREADED 0 // Disable threading for Emscripten/WASM
67+
#else
6568
#define XA_MULTITHREADED 1
6669
#endif
70+
#endif
6771

6872
#define XA_STR(x) #x
6973
#define XA_XSTR(x) XA_STR(x)
@@ -1888,7 +1892,7 @@ class TaskScheduler
18881892

18891893
TaskGroupHandle createTaskGroup(void* userData = nullptr, uint32_t reserveSize = 0)
18901894
{
1891-
TaskGroup* group = XA_NEW(MemTag::Default, TaskGroup);
1895+
TaskGroup* group = XA_NEW(TaskGroup);
18921896
group->queue.reserve(reserveSize);
18931897
group->userData = userData;
18941898
m_groups.push_back(group);

0 commit comments

Comments
 (0)