From: Frode Solheim Date: Fri, 18 Sep 2015 22:00:06 +0000 (+0200) Subject: JIT: updated cache_size usage, remove unused cache_alloc / cache_free X-Git-Tag: 3200~62^2~4 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=e39b4670eca1f0a4bc16fcb4127dc6ba0f985390;p=francis%2Fwinuae.git JIT: updated cache_size usage, remove unused cache_alloc / cache_free --- diff --git a/include/memory.h b/include/memory.h index 713f6680..95a177c6 100644 --- a/include/memory.h +++ b/include/memory.h @@ -14,9 +14,6 @@ extern void a1000_reset (void); #ifdef JIT extern int special_mem; - -extern uae_u8 *cache_alloc (int); -extern void cache_free (uae_u8*); #endif #define S_READ 1 diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 9102ca81..597476db 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -121,8 +121,6 @@ extern bool canbang; #include "compemu_prefs.cpp" -#define cache_size currprefs.cachesize - #define uint32 uae_u32 #define uint8 uae_u8 @@ -249,12 +247,8 @@ static bool follow_const_jumps = true; // Flag: translation through constant j const bool follow_const_jumps = false; #endif -#ifdef UAE -/* ... */ -#else -const uae_u32 MIN_CACHE_SIZE = 1024; // Minimal translation cache size (1 MB) -static uae_u32 cache_size = 0; // Size of total cache allocated for compiled blocks -#endif +const uae_u32 MIN_CACHE_SIZE = 1024; // Minimal translation cache size (1 MB) +static uae_u32 cache_size = 0; // Size of total cache allocated for compiled blocks static uae_u32 current_cache_size = 0; // Cache grows upwards: how much has been consumed already static bool lazy_flush = true; // Flag: lazy translation cache invalidation #ifdef UAE @@ -3440,6 +3434,9 @@ void alloc_cache(void) compiled_code = 0; } +#ifdef UAE + cache_size = currprefs.cachesize; +#endif if (cache_size == 0) return; diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index ca5dfe85..c841f456 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -49,22 +49,6 @@ static void virtualfreewithlock (LPVOID addr, SIZE_T size, DWORD freetype) VirtualFree(addr, size, freetype); } -#ifdef JIT -#ifdef _WIN32 - -void cache_free (uae_u8 *cache) -{ - virtualfreewithlock (cache, 0, MEM_RELEASE); -} - -uae_u8 *cache_alloc (int size) -{ - return virtualallocwithlock (NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); -} - -#endif /*_WIN32 */ -#endif /* JIT */ - static uae_u32 lowmem (void) { uae_u32 change = 0;