]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Restrict minimum non-zero JIT cache size.
authorToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:12:40 +0000 (22:12 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:12:40 +0000 (22:12 +0300)
include/newcpu.h
main.cpp

index 27a903e070c947ea3084bf4fd782b63713db516e..0ef777c7d7b13fc4576a3af991221fbd75f19bfa 100644 (file)
@@ -66,6 +66,7 @@ struct cputbl {
 };
 
 #ifdef JIT
+#define MIN_JIT_CACHE 128
 #define MAX_JIT_CACHE 16384
 typedef uae_u32 REGPARAM3 compop_func (uae_u32) REGPARAM;
 
index fe59461f2d31a46d3a6d9a921cd444f9b56bb158..c25f2a42d53d24ff160ff04acb65e4876701b582 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -573,8 +573,8 @@ void fixup_prefs (struct uae_prefs *p, bool userconfig)
                p->comptrustnaddr = 1;
                err = 1;
        }
-       if (p->cachesize < 0 || p->cachesize > 16384) {
-               error_log (_T("Bad value for cachesize parameter: value must be within 0..16384."));
+       if (p->cachesize < 0 || p->cachesize > MAX_JIT_CACHE || (p->cachesize > 0 && p->cachesize < MIN_JIT_CACHE)) {
+               error_log (_T("Bad value for cachesize parameter: value must zero or within %d..%d."), MIN_JIT_CACHE, MAX_JIT_CACHE);
                p->cachesize = 0;
                err = 1;
        }