help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

hook operator new


From: skaller
Subject: hook operator new
Date: Sun, 14 Oct 2007 12:06:25 -0000
User-agent: pan 0.120 (Plate of Shrimp)

So I have another (yes I tried to find the answer but haven't yet):
how can I hook operator new()?

With malloc() we have __builtin_malloc which is a single global variable
available to all shared libraries. That's cool but there seems
no equivalent for operator new().

operator new() is a weak symbol in Elf isn't it? So it can be replaced
by a user function globally? (even in by a shared library?)

[Of course C++ Standard is quite stupid here. If you replace operator
new, how do you call the original?]

-- 
John Skaller <skaller at users dot sf dot net>
Try Felix, the successor to C++ http://felix.sf.net


reply via email to

[Prev in Thread] Current Thread [Next in Thread]