2009-01-12 15:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/fm.c
* harbour/include/hbwmain.c
* use HeapAlloc( GetProcessHeap(), ... ) instead of LocalAlloc()
when HB_FM_WIN32_ALLOC macro is set - Toninho's tests show that
it's a little bit more efficient - thanks.
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-01-12 15:15 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/vm/fm.c
|
||||
* harbour/include/hbwmain.c
|
||||
* use HeapAlloc( GetProcessHeap(), ... ) instead of LocalAlloc()
|
||||
when HB_FM_WIN32_ALLOC macro is set - Toninho's tests show that
|
||||
it's a little bit more efficient - thanks.
|
||||
|
||||
2009-01-09 17:59 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/contrib/hbct/ftoc.c
|
||||
* harbour/contrib/hbct/misc1.c
|
||||
|
||||
@@ -71,6 +71,7 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */
|
||||
LPSTR pArgs, pArg, pDst, pSrc, pFree;
|
||||
BOOL fQuoted;
|
||||
int iErrorCode;
|
||||
HANDLE hHeap;
|
||||
|
||||
/* HB_TRACE(HB_TR_DEBUG, ("WinMain(%p, %p, %s, %d)", hInstance, hPrevInstance, lpCmdLine, iCmdShow)); */
|
||||
|
||||
@@ -83,7 +84,8 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */
|
||||
#else
|
||||
pSrc = pFree = lpCmdLine;
|
||||
#endif
|
||||
pDst = pArgs = ( LPSTR ) LocalAlloc( LMEM_FIXED, strlen( pFree ) + 1 );
|
||||
hHeap = GetProcessHeap();
|
||||
pDst = pArgs = ( LPSTR ) HeapAlloc( hHeap, 0, strlen( pFree ) + 1 );
|
||||
fQuoted = FALSE;
|
||||
|
||||
while( *pSrc != 0 && s_argc < HB_MAX_ARGS )
|
||||
@@ -135,7 +137,7 @@ int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */
|
||||
iErrorCode = main( s_argc, s_argv );
|
||||
#endif
|
||||
|
||||
LocalFree( pArgs );
|
||||
HeapFree( hHeap, 0, ( void * ) pArgs );
|
||||
|
||||
return iErrorCode;
|
||||
}
|
||||
|
||||
@@ -152,9 +152,15 @@
|
||||
# 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 ) )
|
||||
# if defined( HB_FM_LOCALALLOC )
|
||||
# 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 ) )
|
||||
# else
|
||||
# define malloc( n ) ( void * ) HeapAlloc( GetProcessHeap(), 0, ( n ) )
|
||||
# define realloc( p, n ) ( void * ) HeapReAlloc( GetProcessHeap(), 0, ( void * ) ( p ), ( n ) )
|
||||
# define free( p ) HeapFree( GetProcessHeap(), 0, ( void * ) ( p ) )
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined( HB_MT_VM ) && ( defined( HB_FM_STATISTICS ) || \
|
||||
|
||||
Reference in New Issue
Block a user