diff --git a/xwords4/android/XWords4/res/values/common_rsrc.xml b/xwords4/android/XWords4/res/values/common_rsrc.xml index 9b384ca12..5e4d424ee 100644 --- a/xwords4/android/XWords4/res/values/common_rsrc.xml +++ b/xwords4/android/XWords4/res/values/common_rsrc.xml @@ -239,7 +239,7 @@ Viccionari :ca: - http://ca.m.wiktionary.org/wiki/%2$s + http://ca.wiktionary.org/w/index.php?search=%2$s Google diff --git a/xwords4/common/mempool.c b/xwords4/common/mempool.c index d0201f2fc..799cce0a8 100644 --- a/xwords4/common/mempool.c +++ b/xwords4/common/mempool.c @@ -37,6 +37,7 @@ typedef struct MemPoolEntry { XP_U32 lineNo; XP_U32 size; void* ptr; + XP_U16 index; } MemPoolEntry; struct MemPoolCtx { @@ -97,14 +98,16 @@ void mpool_destroy( MemPoolCtx* mpool ) { if ( mpool->nUsed > 0 ) { - XP_WARNF( "leaking %d blocks", mpool->nUsed ); + XP_WARNF( "leaking %d blocks (of %d allocs)", mpool->nUsed, + mpool->nAllocs ); } if ( !!mpool->usedList ) { MemPoolEntry* entry; for ( entry = mpool->usedList; !!entry; entry = entry->next ) { #ifndef FOR_GREMLINS /* I don't want to hear about this right now */ - XP_LOGF( "%s: " XP_P " in %s, ln %ld of %s\n", __func__, - entry->ptr, entry->func, entry->lineNo, entry->fileName ); + XP_LOGF( "%s: " XP_P " index=%d, in %s, ln %ld of %s\n", __func__, + entry->ptr, entry->index, + entry->func, entry->lineNo, entry->fileName ); #ifdef DEBUG { char* tryTxt; @@ -149,13 +152,13 @@ mpool_alloc( MemPoolCtx* mpool, XP_U32 size, const char* file, entry->size = size; entry->ptr = XP_PLATMALLOC( size ); XP_ASSERT( !!entry->ptr ); + entry->index = ++mpool->nAllocs; ++mpool->nUsed; - ++mpool->nAllocs; #ifdef MPOOL_DEBUG - XP_LOGF( "%s(size=%ld,file=%s,lineNo=%ld)=>%p", - __func__, size, file, lineNo, entry->ptr ); + XP_LOGF( "%s(size=%ld,index=%d,file=%s,lineNo=%ld)=>%p", + __func__, size, entry->index, file, lineNo, entry->ptr ); #endif return entry->ptr; @@ -226,8 +229,8 @@ mpool_free( MemPoolCtx* mpool, void* ptr, const char* file, } else { #ifdef MPOOL_DEBUG - XP_LOGF( "%s(ptr=%p):size=%ld,func=%s,file=%s,lineNo=%ld)", __func__, - entry->ptr, entry->size, entry->func, entry->fileName, + XP_LOGF( "%s(ptr=%p):size=%ld,index=%d,func=%s,file=%s,lineNo=%ld)", __func__, + entry->ptr, entry->size, entry->index, entry->func, entry->fileName, entry->lineNo ); #endif diff --git a/xwords4/common/server.c b/xwords4/common/server.c index ce462c5d2..7dd5b5010 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -1404,7 +1404,6 @@ server_sendInitialMessage( ServerCtxt* server ) static void freeBWI( MPFORMAL BadWordInfo* bwi ) { - /* BadWordInfo* bwi = &server->illegalWordInfo; */ XP_U16 nWords = bwi->nWords; while ( nWords-- ) { @@ -1884,7 +1883,7 @@ storeBadWords( const XP_UCHAR* word, XP_Bool isLegal, if ( !isLegal ) { ServerCtxt* server = (ServerCtxt*)closure; - XP_STATUSF( "storeBadWords called with \"%s\"", word ); + XP_LOGF( "storeBadWords called with \"%s\"", word ); server->illegalWordInfo.words[server->illegalWordInfo.nWords++] = copyString( server->mpool, word ); @@ -2115,7 +2114,9 @@ reflectMoveAndInform( ServerCtxt* server, XWStreamCtxt* stream ) (TrayTileSet*)NULL, sourceClientIndex ); server->vol.showPrevMove = XP_TRUE; - mvStream = makeMoveReportIf( server, &wordsStream ); + if ( isLegalMove ) { + mvStream = makeMoveReportIf( server, &wordsStream ); + } success = model_commitTurn( model, whoMoved, &newTiles ); resetEngines( server );