 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jonathan Baccash Guest
|
Posted: Mon Aug 16, 2004 10:50 am Post subject: Overriding operator new |
|
|
Is there a platform-independent way to override the global new
operator in the presence of dynamically loaded shared libraries?
What's the best way? I've had problems getting all my dlls to call my
memory management functions. I've resorted to defining a facade global
new/delete in every shared library and every executable, which seems
to work, but is there a gotcha to this approach? Wouldn't it be
possible for C++ to provide a better hook to override this behavior
from an executable, i.e. a function to set the memory allocator, and a
means to ensure this function is called before any other code is run?
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Francis Glassborow Guest
|
Posted: Mon Aug 16, 2004 3:05 pm Post subject: Re: Overriding operator new |
|
|
In article <e0e4cb3e.0408152136.6bdf5e47 (AT) posting (DOT) google.com>, Jonathan
Baccash <jbaccash (AT) gmail (DOT) com> writes
| Quote: | Is there a platform-independent way to override the global new
operator in the presence of dynamically loaded shared libraries?
|
No, nor can there be unless and until we add the concept of such
libraries into the C++ Standard.
--
Francis Glassborow ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|