mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Keep maxbins in sync with max threaded cache. Fixes memory corruption and out of bounds access
git-svn-id: https://svn.eduke32.com/eduke32@1441 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
3d0c34863d
commit
f38c6ceea7
1 changed files with 12 additions and 0 deletions
|
@ -88,10 +88,22 @@ DEALINGS IN THE SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
#if 1
|
#if 1
|
||||||
/* The number of cache entries for finer grained bins. This is (topbitpos(THREADCACHEMAX)-4)*2 */
|
/* The number of cache entries for finer grained bins. This is (topbitpos(THREADCACHEMAX)-4)*2 */
|
||||||
|
#if THREADCACHEMAX == 8192
|
||||||
#define THREADCACHEMAXBINS ((13-4)*2)
|
#define THREADCACHEMAXBINS ((13-4)*2)
|
||||||
|
#elif THREADCACHEMAX == 65536
|
||||||
|
#define THREADCACHEMAXBINS ((16-4)*2)
|
||||||
|
#else
|
||||||
|
#error undefined size
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
/* The number of cache entries. This is (topbitpos(THREADCACHEMAX)-4) */
|
/* The number of cache entries. This is (topbitpos(THREADCACHEMAX)-4) */
|
||||||
|
#if THREADCACHEMAX == 8192
|
||||||
#define THREADCACHEMAXBINS (13-4)
|
#define THREADCACHEMAXBINS (13-4)
|
||||||
|
#elif THREADCACHEMAX == 65536
|
||||||
|
#define THREADCACHEMAXBINS (16-4)
|
||||||
|
#else
|
||||||
|
#error undefined size
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
/* Point at which the free space in a thread cache is garbage collected */
|
/* Point at which the free space in a thread cache is garbage collected */
|
||||||
#ifndef THREADCACHEMAXFREESPACE
|
#ifndef THREADCACHEMAXFREESPACE
|
||||||
|
|
Loading…
Reference in a new issue