Lines Matching refs:desc
97 StackDesc desc; in AllocStack() local
116 desc.stackMemoryBytesCount = pagesCount * pageSize; in AllocStack()
117 …desc.stackMemory = (char*)VirtualAlloc(NULL, desc.stackMemoryBytesCount, MW_MEM_COMMIT, MW_PAGE_RE… in AllocStack()
118 MT_ASSERT(desc.stackMemory != NULL, "Can't allocate memory"); in AllocStack()
120 desc.stackBottom = desc.stackMemory + pageSize; in AllocStack()
121 desc.stackTop = desc.stackMemory + desc.stackMemoryBytesCount; in AllocStack()
124 MW_BOOL res = VirtualProtect(desc.stackMemory, pageSize, MW_PAGE_NOACCESS, &oldProtect); in AllocStack()
142 desc.stackMemoryBytesCount = pagesCount * pageSize; in AllocStack()
143 …desc.stackMemory = (char*)mmap(NULL, desc.stackMemoryBytesCount, PROT_READ | PROT_WRITE, MAP_PRIV… in AllocStack()
145 MT_ASSERT((void *)desc.stackMemory != (void *)-1, "Can't allocate memory"); in AllocStack()
147 desc.stackBottom = desc.stackMemory + pageSize; in AllocStack()
148 desc.stackTop = desc.stackMemory + desc.stackMemoryBytesCount; in AllocStack()
150 int res = mprotect(desc.stackMemory, pageSize, PROT_NONE); in AllocStack()
157 return desc; in AllocStack()
160 void Memory::FreeStack(const Memory::StackDesc & desc) in FreeStack() argument
164 int res = VirtualFree(desc.stackMemory, 0, MW_MEM_RELEASE); in FreeStack()
170 int res = munmap(desc.stackMemory, desc.stackMemoryBytesCount); in FreeStack()