From c51f057715587f133abe9bfb32d6d453a7af698b Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Tue, 1 Apr 2014 19:43:58 -0700 Subject: Initial work on Windows port --- mem_win.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 mem_win.c (limited to 'mem_win.c') diff --git a/mem_win.c b/mem_win.c new file mode 100644 index 0000000..8a76712 --- /dev/null +++ b/mem_win.c @@ -0,0 +1,15 @@ +/* + Copyright 2013 Michael Pavone + This file is part of BlastEm. + BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text. +*/ + +#include "mem.h" +#include + +void * alloc_code(size_t *size) +{ + *size += PAGE_SIZE - (*size & (PAGE_SIZE - 1)); + + return VirtualAlloc(NULL, *size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); +} -- cgit v1.2.3