Advertisement
AliAbdulKareem

Untitled

Mar 5th, 2024
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. u64 TotalSize = Chunk1Size + Chunk2Size;
  2. void* base_ = VirtualAlloc(BaseAddr, TotalSize, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
  3.  
  4. void* Chunk2Mem = (u8*)base_ + Chunk1Size);
  5.  
  6. //------ sometime later in the code -------//
  7. if(!VirtualFree(Chunk2Mem, 0, MEM_RELESAE))
  8. {
  9.     Assert("deallocation failed"); // this never happened
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement