on close and in debug build, print how many strings were loaded

This commit is contained in:
ehouse 2009-05-10 15:11:59 +00:00
parent a53951a4f5
commit b0bf95ea8a

View file

@ -1,4 +1,4 @@
/* -*- compile-command: "make -j3 TARGET_OS=wince DEBUG=TRUE RELAY_NAME_DEFAULT=localhost" -*- */
/* -*- compile-command: "make -j3 TARGET_OS=wince DEBUG=TRUE"; -*- */
/*
* Copyright 2009 by Eric House (xwords@eehouse.org). All rights reserved.
*
@ -141,6 +141,9 @@ ceGetResStringL( CEAppGlobals* globals, XP_U16 resID )
void
ceFreeResStrings( CEAppGlobals* globals )
{
#ifdef DEBUG
XP_U16 nUsed = 0;
#endif
ResStrStorage* storage = (ResStrStorage*)globals->resStrStorage;
if ( !!storage ) {
XP_U16 ii;
@ -148,12 +151,19 @@ ceFreeResStrings( CEAppGlobals* globals )
ResStrEntry* entry = storage->entries[ii];
if ( !!entry ) {
XP_FREE( globals->mpool, entry );
#ifdef DEBUG
++nUsed;
#endif
}
}
XP_FREE( globals->mpool, storage );
globals->resStrStorage = NULL;
}
#ifdef DEBUG
XP_LOGF( "%s: %d of %d strings loaded and used", __func__, nUsed,
VSIZE(storage->entries) );
#endif
}
#endif