From ac770ac643ff6249bc4188769651946b4b55ddac Mon Sep 17 00:00:00 2001 From: Andi Jahja Date: Mon, 31 Dec 2001 07:39:55 +0000 Subject: [PATCH] Andi Jahja --- harbour/ChangeLog | 6 ++++++ harbour/include/hbapi.h | 8 ++++---- harbour/source/vm/maindllp.c | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 7559aba0af..37aa47c2bb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,12 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + * source/vm/fm.c + Memory allocation error was transparently noticed when running + hbtest.exe with -DHB_FM_STATISTICS_OFF, fixed. + * function hb_xgrab() + fix memory allocation on function hb_xgrab() by adding extra bytes + to be allocated in line with byte alignment. 2001-12-31 13:22 UTC+0100 Viktor Szakats diff --git a/harbour/include/hbapi.h b/harbour/include/hbapi.h index 4325777dd2..1a767700f5 100644 --- a/harbour/include/hbapi.h +++ b/harbour/include/hbapi.h @@ -342,10 +342,10 @@ extern void HB_EXPORT hb_stornd( double dValue, int iParam, ... ); /* stores a extern void HB_EXPORT hb_xinit( void ); /* Initialize fixed memory subsystem */ extern void HB_EXPORT hb_xexit( void ); /* Deinitialize fixed memory subsystem */ -extern void * HB_EXPORT hb_xalloc( ULONG ulSize ); /* allocates memory, returns NULL on failure */ -extern void * HB_EXPORT hb_xgrab( ULONG ulSize ); /* allocates memory, exits on failure */ -extern void HB_EXPORT hb_xfree( void * pMem ); /* frees memory */ -extern void * HB_EXPORT hb_xrealloc( void * pMem, ULONG ulSize ); /* reallocates memory */ +extern void HB_EXPORT * hb_xalloc( ULONG ulSize ); /* allocates memory, returns NULL on failure */ +extern void HB_EXPORT * hb_xgrab( ULONG ulSize ); /* allocates memory, exits on failure */ +extern void HB_EXPORT hb_xfree( void * pMem ); /* frees memory */ +extern void HB_EXPORT * hb_xrealloc( void * pMem, ULONG ulSize ); /* reallocates memory */ extern ULONG HB_EXPORT hb_xsize( void * pMem ); /* returns the size of an allocated memory block */ extern ULONG hb_xquery( USHORT uiMode ); /* Query different types of memory information */ diff --git a/harbour/source/vm/maindllp.c b/harbour/source/vm/maindllp.c index 24d89ccfdb..2b43fd527e 100644 --- a/harbour/source/vm/maindllp.c +++ b/harbour/source/vm/maindllp.c @@ -62,7 +62,7 @@ #if defined(HB_OS_WIN_32) -BOOL WINAPI HB_EXPORT DllEntryPoint( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved ) +BOOL HB_EXPORT WINAPI DllEntryPoint( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved ) { HB_TRACE( HB_TR_DEBUG, ("DllEntryPoint(%p, %p, %d)", hInstance, fdwReason, pvReserved ) ); @@ -383,7 +383,7 @@ char * hb_pardsbuff( char * szDate, int iParam, ... ) /* retrieve a date as a st int hb_parl( int iParam, ... ) /* retrieve a logical parameter as an int */ { - int iReturn; + /* int iReturn; */ FARPROC pParL=GetProcAddress( GetModuleHandle( NULL ), "_hb_parl" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" ); @@ -435,7 +435,7 @@ double hb_parnd( int iParam, ... ) /* retrieve a numeric parameter as a double * int hb_parni( int iParam, ... ) /* retrieve a numeric parameter as a integer */ { - int iReturn; + /* int iReturn; */ FARPROC pParNi=GetProcAddress( GetModuleHandle( NULL ), "_hb_parni" ); FARPROC pExtIsArray = GetProcAddress( GetModuleHandle( NULL ), "_hb_extIsArray" );