| 94 | } |
| 95 | |
| 96 | static void Protect(void* stack, size_t size, bool /*checkPrevious*/) noexcept { |
| 97 | Y_ASSERT( !((size_t)stack & PageSizeMask) ); // stack pointer should be page aligned |
| 98 | Y_ASSERT( !(size & PageSizeMask) ); // stack size should be page aligned |
| 99 | Y_ASSERT(size >= PageSize); // stack should have enough space to place guard |
| 100 | |
| 101 | ProtectMemory((char*)stack + size - PageSize, PageSize, PM_NONE); |
| 102 | } |
| 103 | |
| 104 | //! Remove protection, to allow stack memory be freed |
| 105 | static void RemoveProtection(void* stack, size_t size) noexcept { |
no test coverage detected