Skip to content

Commit cd1b1c0

Browse files
committed
Linux hack
1 parent 6e986f8 commit cd1b1c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/core/libraries/kernel/thread_management.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,16 @@ ScePthread PThreadPool::Create(const char* name) {
10701070
}
10711071
}
10721072

1073+
#ifdef _WIN64
10731074
auto* ret = new PthreadInternal{};
1075+
#else
1076+
// TODO: Linux specific hack
1077+
static u8* hint_address = reinterpret_cast<u8*>(0x7FFFFC000ULL);
1078+
auto* ret = reinterpret_cast<PthreadInternal*>(
1079+
mmap(hint_address, sizeof(PthreadInternal), PROT_READ | PROT_WRITE,
1080+
MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0));
1081+
hint_address += Common::AlignUp(sizeof(PthreadInternal), 4_KB);
1082+
#endif
10741083
ret->is_free = false;
10751084
ret->is_detached = false;
10761085
ret->is_almost_done = false;

0 commit comments

Comments
 (0)