2008-09-18 01:17 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/source/vm/fm.c
  + harbour/source/vm/dlmalloc.c
    + added alternative memory manager written by Doug Lea
      It can be activated by recompiling Harbour with HB_FM_DL_ALLOC macro.
      Please make test on different platforms with different C compilers.
      Linux users will not benefit from it because the default GLIBC MM
      is derived from a version of code.
      NOTE: the results may strongly depend on total memory allocation
      and will be different then in simple memory tests.
This commit is contained in:
Przemyslaw Czerpak
2008-09-17 23:17:45 +00:00
parent 43499ce1b5
commit 5ec4b754b9
3 changed files with 5102 additions and 9 deletions

View File

@@ -8,6 +8,17 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-09-18 01:17 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/fm.c
+ harbour/source/vm/dlmalloc.c
+ added alternative memory manager written by Doug Lea
It can be activated by recompiling Harbour with HB_FM_DL_ALLOC macro.
Please make test on different platforms with different C compilers.
Linux users will not benefit from it because the default GLIBC MM
is derived from a version of code.
NOTE: the results may strongly depend on total memory allocation
and will be different then in simple memory tests.
2008-09-17 22:15 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/rddado/adordd.prg
! Marking one STATIC var as thread STATIC.

5061
harbour/source/vm/dlmalloc.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -66,14 +66,23 @@
*
*/
/* NOTE: This definitions must be ahead of any and all #include statements */
/* For MS-Win builds */
#define HB_OS_WIN_32_USED
/* For Linux and mremap() function */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
/* NOTE: For OS/2. Must be ahead of any and all #include statements */
#define INCL_BASE
#define INCL_DOSMISC
#define INCL_DOSERRORS
#define INCL_DOSPROCESS
/* malloc.h has been obsoleted by stdlib.h, which is included via
hbvmpub.h, which is include via hbapi.h
#include <malloc.h>
@@ -92,11 +101,29 @@
# include "hbthread.h"
#endif
/* #define HB_FM_DL_ALLOC */
/* #define HB_FM_WIN32_ALLOC */
/* #define HB_FM_STATISTICS */
/* #define HB_PARANOID_MEM_CHECK */
#ifndef HB_OS_WIN_32
# undef HB_FM_WIN32_ALLOC
#if defined( HB_FM_DL_ALLOC )
/* # define NO_MALLINFO 1 */
/* # define INSECURE */
/* # define USE_DL_PREFIX */
# define REALLOC_ZERO_BYTES_FREES
# if defined( HB_MT_VM )
# define USE_LOCKS 1
# endif
# include "dlmalloc.c"
# if defined( USE_DL_PREFIX )
# 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 ) )
#endif
#if defined( HB_MT_VM ) && ( defined( HB_FM_STATISTICS ) || \
@@ -113,17 +140,11 @@
#endif
#ifdef HB_FM_WIN32_ALLOC
# 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
#ifndef HB_FM_STATISTICS
# undef HB_PARANOID_MEM_CHECK
#endif
#if defined(HB_FM_STATISTICS) && !defined(HB_TR_LEVEL)
#if defined( HB_FM_STATISTICS ) && !defined( HB_TR_LEVEL )
# define HB_TR_LEVEL HB_TR_ERROR
#endif