MCPcopy Create free account
hub / github.com/catboost/catboost / Protect

Method Protect

library/cpp/coroutine/engine/stack/stack_guards.h:96–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

TYPED_TESTFunction · 0.45
TESTFunction · 0.45
SetUpMethod · 0.45

Calls 1

ProtectMemoryFunction · 0.85

Tested by

no test coverage detected