fix mempool tracking bug

This commit is contained in:
Eric House 2021-03-09 07:45:33 -08:00
parent 8b26d6bc4e
commit bf88c000b7
2 changed files with 5 additions and 1 deletions

View file

@ -280,6 +280,10 @@ mpool_realloc( MemPoolCtx* mpool, void* ptr, XP_U32 newsize, const char* file,
entry->fileName = file;
entry->func = func;
entry->lineNo = lineNo;
mpool->curBytes += newsize - entry->size;
if ( mpool->curBytes > mpool->maxBytes ) {
mpool->maxBytes = mpool->curBytes;
}
entry->size = newsize;
}
result = entry->ptr;

View file

@ -518,7 +518,7 @@ showName( GameState* gs )
Globals* globals = gs->globals;
title = gs->gameName;
char buf[64];
if ( true || 1 < countDicts( globals ) ) {
if ( 1 < countDicts( globals ) ) {
char langName[32];
if ( !langNameFor( globals, gs->gi.dictLang, langName, sizeof(langName) ) ) {
strcpy( langName, "??" );