CringeDB/System Abstraction/win32/cdb_memory.c

18 lines
588 B
C
Raw Permalink Normal View History

2024-02-18 17:42:05 +01:00
#include "../cdb_system.h"
#include <windows.h>
2024-02-18 17:42:05 +01:00
// returns NULL, if there is no memory left or an error occured
void * sys_heapAlloc(size_t bytes){
return HeapAlloc(GetProcessHeap(), 0, bytes); //generic call to the windows heapAlloc function
}
2024-02-18 17:42:05 +01:00
// returns NULL, if there is no memory left or an error occured
void * sys_heapResize(void * memory, size_t newBytes){
return HeapReAlloc(GetProcessHeap(), 0, memory, newBytes);
}
// what should this function do, if an error occurse..
2024-02-18 17:42:05 +01:00
void sys_heapFree(void * memory){
HeapFree(GetProcessHeap(), 0, memory);
}