aboutsummaryrefslogtreecommitdiff
path: root/src/un_mem_win_x64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/un_mem_win_x64.c')
-rw-r--r--src/un_mem_win_x64.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/un_mem_win_x64.c b/src/un_mem_win_x64.c
new file mode 100644
index 0000000..91f838f
--- /dev/null
+++ b/src/un_mem_win_x64.c
@@ -0,0 +1,18 @@
+#include <windows.h>
+
+static ALLOCATOR_PROC_SIGNATURE(un_std_alloc_proc) {
+ UNUSED(data);
+
+ switch (message) {
+ case UN_ALLOC_MSG_ALLOCATE:
+ return VirtualAlloc(NULL, (SIZE_T)size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
+ case UN_ALLOC_MSG_FREE:
+ if (!VirtualFree(p, 0, MEM_RELEASE)) {
+ assert(false);
+ }
+ break;
+ case UN_ALLOC_MSG_SELF_DELETE: break;
+ }
+
+ return NULL;
+}