diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 704c25657f..a4416dc106 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,12 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-24 16:18 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * source/vm/fm.c + + Enabled dlmalloc (HB_FM_DL_ALLOC) for MSVC, BCC and MINGW builds. + ; It's possible to disable dlmalloc with HB_FM_STD_ALLOC + for testing purposes. + 2008-09-24 16:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * bin/bld.bat * bin/bld_os2.cmd diff --git a/harbour/source/vm/fm.c b/harbour/source/vm/fm.c index 81135d97d7..cabf6380e4 100644 --- a/harbour/source/vm/fm.c +++ b/harbour/source/vm/fm.c @@ -101,7 +101,16 @@ # include "hbthread.h" #endif -/* #define HB_FM_DL_ALLOC */ +#if defined( HB_FM_STD_ALLOC ) + #undef HB_FM_DL_ALLOC +#elif !defined( HB_FM_DL_ALLOC ) + #if defined( _MSC_VER ) || defined( __BORLANDC__ ) || defined( __MINGW32__ ) + #define HB_FM_DL_ALLOC + #else + /* #define HB_FM_DL_ALLOC */ + #endif +#endif + /* #define HB_FM_WIN32_ALLOC */ /* #define HB_FM_STATISTICS */ /* #define HB_PARANOID_MEM_CHECK */ @@ -134,14 +143,14 @@ # pragma warn +rch # endif # if defined( USE_DL_PREFIX ) -# define malloc( n ) dlmalloc( (n) ) -# define realloc( p, n ) dlrealloc( (p), (n) ) -# define free( p ) dlfree( (p) ) +# define malloc( n ) dlmalloc( ( n ) ) +# define realloc( p, n ) dlrealloc( ( p ), ( n ) ) +# define free( p ) dlfree( ( p ) ) # endif #elif defined( HB_FM_WIN32_ALLOC ) && defined( HB_OS_WIN_32 ) -# define malloc( n ) (void *) LocalAlloc( LMEM_FIXED, ( n ) ) -# define realloc( p, n ) (void *) LocalReAlloc( (HLOCAL) ( p ), ( n ), LMEM_MOVEABLE ) -# define free( p ) LocalFree( (HLOCAL) ( p ) ) +# define malloc( n ) ( void * ) LocalAlloc( LMEM_FIXED, ( n ) ) +# define realloc( p, n ) ( void * ) LocalReAlloc( ( HLOCAL ) ( p ), ( n ), LMEM_MOVEABLE ) +# define free( p ) LocalFree( ( HLOCAL ) ( p ) ) #endif #if defined( HB_MT_VM ) && ( defined( HB_FM_STATISTICS ) || \