Fixing page guards to work at system page granularity.
This commit is contained in:
@@ -46,9 +46,11 @@ ThreadState::ThreadState(Processor* processor, uint32_t thread_id,
|
||||
backend_data_ = processor->backend()->AllocThreadData();
|
||||
|
||||
if (!stack_address) {
|
||||
// We must always allocate 64K as a guard region before stacks, as we can
|
||||
// only Protect() on system page granularity.
|
||||
stack_size = (stack_size + 0xFFF) & 0xFFFFF000;
|
||||
uint32_t stack_alignment = (stack_size & 0xF000) ? 0x1000 : 0x10000;
|
||||
uint32_t stack_padding = stack_alignment * 1;
|
||||
uint32_t stack_padding = xe::page_size(); // Host page size.
|
||||
uint32_t actual_stack_size = stack_padding + stack_size;
|
||||
bool top_down;
|
||||
switch (stack_type) {
|
||||
|
||||
Reference in New Issue
Block a user