Windows x86 32-bit recompiler should now work with DEP enabled.

This commit is contained in:
TomW 2015-09-03 18:35:58 +01:00
commit 4c8e892872

View file

@ -19,6 +19,9 @@
#include <sys/mman.h>
#include <unistd.h>
#endif
#if defined WIN32 || defined _WIN32 || defined _WIN32
#include <windows.h>
#endif
int codegen_flags_changed = 0;
int codegen_fpu_entered = 0;
@ -63,7 +66,11 @@ void codegen_init()
long pagemask = ~(pagesize - 1);
#endif
#if defined WIN32 || defined _WIN32 || defined _WIN32
codeblock = VirtualAlloc(NULL, BLOCK_SIZE * sizeof(codeblock_t), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
#else
codeblock = malloc(BLOCK_SIZE * sizeof(codeblock_t));
#endif
codeblock_hash = malloc(HASH_SIZE * sizeof(codeblock_t *));
memset(codeblock, 0, BLOCK_SIZE * sizeof(codeblock_t));