C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Overriding operator new

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated)
View previous topic :: View next topic  
Author Message
Jonathan Baccash
Guest





PostPosted: Mon Aug 16, 2004 10:50 am    Post subject: Overriding operator new Reply with quote



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





PostPosted: Mon Aug 16, 2004 3:05 pm    Post subject: Re: Overriding operator new Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ Language (Moderated) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.