Changing page_size to allocation granularity.
This commit is contained in:
parent
172b14a8a5
commit
92f5fe3b88
|
@ -23,7 +23,7 @@ size_t page_size() {
|
||||||
#if XE_PLATFORM_WIN32
|
#if XE_PLATFORM_WIN32
|
||||||
SYSTEM_INFO si;
|
SYSTEM_INFO si;
|
||||||
GetSystemInfo(&si);
|
GetSystemInfo(&si);
|
||||||
value = si.dwPageSize;
|
value = si.dwAllocationGranularity;
|
||||||
#else
|
#else
|
||||||
value = getpagesize();
|
value = getpagesize();
|
||||||
#endif // XE_PLATFORM_WIN32
|
#endif // XE_PLATFORM_WIN32
|
||||||
|
|
|
@ -50,7 +50,7 @@ ThreadState::ThreadState(Processor* processor, uint32_t thread_id,
|
||||||
// only Protect() on system page granularity.
|
// only Protect() on system page granularity.
|
||||||
stack_size = (stack_size + 0xFFF) & 0xFFFFF000;
|
stack_size = (stack_size + 0xFFF) & 0xFFFFF000;
|
||||||
uint32_t stack_alignment = (stack_size & 0xF000) ? 0x1000 : 0x10000;
|
uint32_t stack_alignment = (stack_size & 0xF000) ? 0x1000 : 0x10000;
|
||||||
uint32_t stack_padding = xe::page_size(); // Host page size.
|
uint32_t stack_padding = uint32_t(xe::page_size()); // Host page size.
|
||||||
uint32_t actual_stack_size = stack_padding + stack_size;
|
uint32_t actual_stack_size = stack_padding + stack_size;
|
||||||
bool top_down;
|
bool top_down;
|
||||||
switch (stack_type) {
|
switch (stack_type) {
|
||||||
|
|
Loading…
Reference in New Issue