On Mon, 14 Dec 2009, Bisz István wrote:
Hi,
> Hi Przemek,
[...]
> My question is, do we need to force the USE_DL_PREFIX macro for the mingw
> default builds as for MSC?
It's possible. Replacing default malloc()/free() functions have to be
global. Some compilers may keep some hardcoded references to default
memory manager and in such case they will crash when memory pointers
from two different memory manager are mixed.
In this case with HBQT you are introducing C++ RTL which may use it's
own references to build in memory manager. It's possible that adding
this code to one of HBQT CPP files will resolve the problem:
void * operator new( size_t nSize ) { return hb_xgrab( nSize ); }
void operator delete( void * p ) { hb_xfree( p ); }
You can test it but it may also create new one if some code does not
cleanly removes all allocated objects before HVM exit which may also
deinitialize some other memory managers.
Enabling USE_DL_PREFIX resolves any possible conflicts with C/C++ RTL
though it's less efficient. But if current state creates real problems
then we should change it and enable full memory manager replacement
only on explicit user request by some macro, i.e. HB_FM_DL_PREFIX_OFF.
> Or maybe there are some other approaches like HB_FM_STD_ALLOC macro
> definition.
It's rather inefficients memory manager so for many users it will be
hard to accept it.
best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour