On Fri, 28 Nov 2008, Miguel Angel Marchuet wrote:
>>      Now hb_xgrab/hb_xrealloc allocates unused memory when
>> HB_FM_STATISTICS is not defined.
> Please can you be more explicit please?
> thank's
> I don't found any incorrect by the moment

void * hb_xgrab( ULONG ulSize )
{
    PHB_MEMINFO pMem;
    HB_TRACE_FM(HB_TR_DEBUG, ("hb_xgrab(%lu)", ulSize));
    if( ulSize == 0 )
       hb_errInternal( HB_EI_XGRABNULLSIZE, NULL, NULL, NULL );
    pMem = ( PHB_MEMINFO ) malloc( HB_ALLOC_SIZE( ulSize ) );
    if( ! pMem )
       hb_errInternal( HB_EI_XGRABALLOC, NULL, NULL, NULL );
#ifdef HB_FM_STATISTICS
    ... HB_FM_STATISTICS not defined ... cut ...
#endif

    //
    // No HB_FM_STATISTICS defined...  <-------------------------
    // Why must count it?              <-------------------------
    //
    HB_ATOMIC_SET( HB_COUNTER_PTR( HB_MEM_PTR( pMem ) ), 1 );
    return HB_MEM_PTR( pMem );
}

     Additionally, this is nested to another #ifdef HB_FM_STATISTICS
structure:

954 : #ifdef HB_FM_STATISTICS
955 :    OutputDebugString( "with HB_FM_STATISTICS activated." );
956 : #endif

     Whole hb_xexit() is HB_FM_STATISTICS specific, so this message is
redundant.

Atte.
  Vic

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to