From fe41356a9dcf1c62d7201f97533f16a4dbf95135 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Thu, 7 Nov 2013 08:47:35 +0000 Subject: [PATCH] fix for the memory allocation in the jitter which should work for Windows. --- src/runtime/c/pgf/jit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/c/pgf/jit.c b/src/runtime/c/pgf/jit.c index a74fb9e40..250b5a3a6 100644 --- a/src/runtime/c/pgf/jit.c +++ b/src/runtime/c/pgf/jit.c @@ -48,10 +48,12 @@ pgf_jit_alloc_page(PgfJitState* state) size_t page_size = getpagesize(); -#ifndef ANDROID - if (posix_memalign(&page, page_size, page_size) != 0) { +#if defined(ANDROID) + if ((page = memalign(page_size, page_size)) == NULL) { +#elif defined(__MINGW32__) + if ((page = malloc(page_size)) == NULL) { #else - if ((page = memalign(page_size, page_size)) == NULL) { + if (posix_memalign(&page, page_size, page_size) != 0) { #endif gu_fatal("Memory allocation failed"); }