mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +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
|
||||
#if 1
|
||||
/* The number of cache entries for finer grained bins. This is (topbitpos(THREADCACHEMAX)-4)*2 */
|
||||
#if THREADCACHEMAX == 8192
|
||||
#define THREADCACHEMAXBINS ((13-4)*2)
|
||||
#elif THREADCACHEMAX == 65536
|
||||
#define THREADCACHEMAXBINS ((16-4)*2)
|
||||
#else
|
||||
#error undefined size
|
||||
#endif
|
||||
#else
|
||||
/* The number of cache entries. This is (topbitpos(THREADCACHEMAX)-4) */
|
||||
#if THREADCACHEMAX == 8192
|
||||
#define THREADCACHEMAXBINS (13-4)
|
||||
#elif THREADCACHEMAX == 65536
|
||||
#define THREADCACHEMAXBINS (16-4)
|
||||
#else
|
||||
#error undefined size
|
||||
#endif
|
||||
#endif
|
||||
/* Point at which the free space in a thread cache is garbage collected */
|
||||
#ifndef THREADCACHEMAXFREESPACE
|
||||
|
|
Loading…
Reference in a new issue