As part of debug builds, we override new/delete operators to do leak
checking and all sorts of other good-debugging-love. It appears
that with
gcc 4.0.1, overriding new/delete causes problems as system library
allocation calls appear to (periodically?) use our new/delete methods.
The problem becomes serious as it appears our overrides are not
consistantly
called. So in our applications we'll get called for a new, but not
the
correspondiing delete. Or we'll get called for a delete on a
buffer we
never allocated.
I think this is expected behavior, but I agree that it's new in gcc4
(used to build the Intel version of Mac OS X). In Mac OS X 10.4, the
dyld component will automatically coalesce externally-visible symbols
from multiple libraries. gcc4 tends to make more symbols externally
visible than did gcc3, and so the system-provided new/delete
operators are probably being coalesced with your new/delete
operators, and yours are overriding the system-provided operators.
The solution for this problem is most likely to mark your new/delete
operators to have limited visibility outside of their linkage unit.
See <http://developer.apple.com/documentation/DeveloperTools/
Conceptual/CppRuntimeEnv/index.html> for more details on this topic.
-eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden