Hi All,

I've done extented FM Stats ST/MT for HB_FM_STATISTICS with new trace macro 
HB_TRFM().
This allows to show in hb_out.log the allocation of the pointer covert by the 
macro.

HB_TRFM( pPtr = (char *)hb_xgrab( size ) );

or .-

HB_TRFM( pObj = ( QTextDecoder* ) new QTextDecoder( hbqt_par_QTextCodec( 1 ) ) 
);

In order to have in hb_out.log for HB_FM_STATISTICS .-

------------------------------------------------------------------------
...
Total memory allocated: 234123 bytes (4176 block(s))
Warning, memory allocated but not released: 1020 bytes (2 block(s))
Block 1 0xd88970 (size 200) MYFUNCTION(256), "200F200F ..."
myfile.c:256 [ char *pPtr = (char *)hb_xgrab( size ) ]
Block 2 0xe4a990 (size 200) QT_QTEXTDECODER(129), "200F200F ..."
qtcore.cpp:129 [ pObj = ( QTextDecoder* ) new QTextDecoder( 
hbqt_par_QTextCodec( 1 ) ) ]
------------------------------------------------------------------------

I think with this FM Stats do it more human-readable.
The code is 100% compatible with existing. If not used HB_TRFM and 
HB_FM_STATISTICS you have the same until now.

Macro have coverage until the first comma, for example in the expression .-

pObj = ( QPoint* ) new QPoint( hb_parni( 1 ), hb_parni( 2 ) ) ;

Use .-

HB_TRFM( pObj = ( QPoint* ) new QPoint)( hb_parni( 1 ), hb_parni( 2 ) ) ;

If you want I can commit it in SVN.

--
Xavi
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to