Skip to content

Commit 37c5b49

Browse files
committed
fix compilation on linux
1 parent 20f180a commit 37c5b49

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Source/Library/MemoryManager.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,20 @@ namespace sd
4444
return std::make_tuple((uint8_t *)highLimit - 10, (uint8_t *)lowLimit, rsp);
4545
}
4646
#endif
47-
#if defined(LINUX) || defined(APPLE)
47+
#ifdef LINUX
48+
auto getStackBounds()
49+
{
50+
auto rsp = getStackRsp();
51+
pthread_attr_t attrs;
52+
pthread_getattr_np(pthread_self(), &attrs);
53+
void *stack_ptr;
54+
size_t stack_size;
55+
pthread_attr_getstack(&attrs, &stack_ptr, &stack_size);
56+
57+
return std::make_tuple((uint8_t *)stack_ptr + stack_size - 10, (uint8_t *)stack_ptr, rsp);
58+
}
59+
#endif
60+
#ifdef APPLE
4861
auto getStackBounds()
4962
{
5063
auto rsp = getStackRsp();

0 commit comments

Comments
 (0)