Init new repository

This commit is contained in:
Krzosa Karol
2024-04-13 15:29:53 +02:00
commit 5a2e3dcec4
335 changed files with 61571 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#build_if(LC_OS == OS_WINDOWS);
DWORD :: typedef u32;
SIZE_T :: typedef uintptr;
BOOL :: typedef int;
MEM_RESERVE :: 0x00002000;
MEM_COMMIT :: 0x00001000;
PAGE_READWRITE :: 0x04;
VirtualAlloc :: proc(lpAddress: *void, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD): *void; @api
MEM_RELEASE :: 0x00008000;
MEM_DECOMMIT :: 0x00004000;
VirtualFree :: proc(lpAddress: *void, dwSize: SIZE_T, dwFreeType: DWORD): BOOL; @api
VReserve :: proc(size: usize): *void {
result := VirtualAlloc(nil, :SIZE_T(size), MEM_RESERVE, PAGE_READWRITE);
return result;
}
VCommit :: proc(p: *void, size: usize): bool {
result := VirtualAlloc(p, :SIZE_T(size), MEM_COMMIT, PAGE_READWRITE) != 0;
return result;
}
VRelease :: proc(p: *void) {
VirtualFree(p, 0, MEM_RELEASE);
}