From 4d4aeeb4074a6581a503484dac37be2181bf9fc4 Mon Sep 17 00:00:00 2001 From: Istvan Bisz Date: Sat, 2 Jan 2010 21:41:36 +0000 Subject: [PATCH] 2009-01-02 21:59 UTC+0100 Istvan Bisz (istvan.bisz/at/t-online.hu) * /src/vm/fm.c * Not adequate defitions of the subsequent CRT functions for the MinGW implemetations: #ifndef USE_DL_PREFIX #define dlcalloc calloc #define dlfree free #define dlmalloc malloc ... #endif /* USE_DL_PREFIX */ The malloc/free CRT functions should'nt be redefined in this way. * The mesage: "Warning, memory allocated but not released..." is sent on request (//INFO cmdarg). --- harbour/ChangeLog | 12 ++++++++++++ harbour/src/vm/fm.c | 14 ++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 144bd5a593..ae769048e6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,18 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-01-02 22:59 UTC+0100 Istvan Bisz (istvan.bisz/at/t-online.hu) + * /src/vm/fm.c + * Not adequate defitions of the subsequent CRT functions for the MinGW implemetations: + #ifndef USE_DL_PREFIX + #define dlcalloc calloc + #define dlfree free + #define dlmalloc malloc + ... + #endif /* USE_DL_PREFIX */ + The malloc/free CRT functions should'nt be redefined in this way. + * The mesage: "Warning, memory allocated but not released..." is sent on request (//INFO cmdarg). + 2010-01-02 22:26 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/hbqt.h + Will now fail with forced compiler error if used with diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index 8f69a75232..f8d89b89e2 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -182,6 +182,10 @@ # if defined( HB_OS_WIN_CE ) # define LACKS_FCNTL_H # endif +# elif defined( __MINGW32__ ) +# if !defined( USE_DL_PREFIX ) && !defined( HB_FM_DLMT_ALLOC ) +# define USE_DL_PREFIX +# endif # endif # if defined( __cplusplus ) && ! defined( USE_DL_PREFIX ) # define USE_DL_PREFIX @@ -1098,6 +1102,10 @@ void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ hb_conOutErr( hb_conNewLine(), 0 ); hb_snprintf( buffer, sizeof( buffer ), HB_I_("Total memory allocated: %li bytes (%li block(s))"), s_lMemoryMaxConsumed, s_lMemoryMaxBlocks ); hb_conOutErr( buffer, 0 ); + hb_conOutErr( hb_conNewLine(), 0 ); + hb_snprintf( buffer, sizeof( buffer ), HB_I_("Warning, memory allocated but not released: %li bytes (%li block(s))"), s_lMemoryConsumed, s_lMemoryBlocks ); + hb_conOutErr( buffer, 0 ); + hb_conOutErr( hb_conNewLine(), 0 ); if( s_lMemoryBlocks ) { @@ -1116,16 +1124,10 @@ void hb_xexit( void ) /* Deinitialize fixed memory subsystem */ fprintf( hLog, "%s\n", buffer ); } - hb_conOutErr( hb_conNewLine(), 0 ); - hb_snprintf( buffer, sizeof( buffer ), HB_I_("Warning, memory allocated but not released: %li bytes (%li block(s))"), s_lMemoryConsumed, s_lMemoryBlocks ); - hb_conOutErr( buffer, 0 ); - if( hLog ) fprintf( hLog, "%s\n", buffer ); } - hb_conOutErr( hb_conNewLine(), 0 ); - for( ui = 1, pMemBlock = s_pFirstBlock; pMemBlock; pMemBlock = pMemBlock->pNextBlock, ++ui ) { HB_TRACE( HB_TR_ERROR, ( "Block %i (size %lu) %s(%i), \"%s\"", ui,