diff --git a/src/codegen_x86.c b/src/codegen_x86.c index 5697e20..57ecdfa 100644 --- a/src/codegen_x86.c +++ b/src/codegen_x86.c @@ -19,6 +19,9 @@ #include #include #endif +#if defined WIN32 || defined _WIN32 || defined _WIN32 +#include +#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));