From 2d3bb88d5019fa301a68f4eac72f5d032b43e6ae Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 2 Jan 2010 23:29:42 +0000 Subject: [PATCH] 2010-01-03 00:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/fm.c + Overriding some additional C++ memory allocation operators to cover the full set required by QT, according to this document: http://doc.trolltech.com/4.5/qt-performance.html#alternative-memory-allocation ; Please report if it causes problem in other areas, also retest HBQT memory allocation after change. --- harbour/ChangeLog | 8 ++++++++ harbour/src/vm/fm.c | 24 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3f0d48e916..9cdad4ac5f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-01-03 00:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/fm.c + + Overriding some additional C++ memory allocation operators + to cover the full set required by QT, according to this document: + http://doc.trolltech.com/4.5/qt-performance.html#alternative-memory-allocation + ; Please report if it causes problem in other areas, also + retest HBQT memory allocation after change. + 2010-01-03 00:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/vm/fm.c ! Fixed to not display "Warning, memory allocated but not released" diff --git a/harbour/src/vm/fm.c b/harbour/src/vm/fm.c index ba9d94698a..301d78b30d 100644 --- a/harbour/src/vm/fm.c +++ b/harbour/src/vm/fm.c @@ -1409,13 +1409,33 @@ HB_BOOL hb_xtraced( void ) } #if defined( __cplusplus ) && defined( HB_FM_STATISTICS ) +void * operator new[]( size_t nSize ) +{ + return hb_xgrab( nSize ); +} + void * operator new( size_t nSize ) { return hb_xgrab( nSize ); } -void operator delete( void * p ) +void operator delete[]( void * ptr ) { - hb_xfree( p ); + hb_xfree( ptr ); +} + +void operator delete[]( void * ptr, size_t ) +{ + hb_xfree( ptr ); +} + +void operator delete( void * ptr ) +{ + hb_xfree( ptr ); +} + +void operator delete( void * ptr, size_t ) +{ + hb_xfree( ptr ); } #endif