Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: UB issue -- include order?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UB issue -- include order?



On Mar 18, 2006, at 12:42 PM, Brad Oliver wrote:

On Mar 18, 2006, at 3:28 AM, email@hidden wrote:

For some reason it is hitting our memory manager inside a clean up of an
Apple Event? I'm not sure why it would hit our own memory manger. I'm not
sure if this is with include path order or what is the cause. We are
redefining new and delete and the such, but I did not think this could
affect Apple's API. I have not encountered this on the PPC. Any
suggestions would be great.

The only explanation I can think of is that Apple's routine calls operator delete - but only on x86. Since you've overridden that exact prototype, the linker chooses yours and they get called for all code...? I could be way off though. ;-)

I think it's more that libstdc++ is a dynamic library as of gcc 4 and 10.4, so when targeting 10.4 or later with gcc 4 if you override operator new and operator delete in the global namespace your versions of them will be used for all calls to those functions. That's true on both Intel and PowerPC.


I think there are ways to get your operator new/operator delete used only for your code, but I'm afraid I don't know enough about C++ to suggest them. Hopefully Howard Hinnant or one of the other C++ experts around here can chime in with the right solution (and whether there's a way to do it at all).

-Eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: UB issue -- include order? (From: Brad Oliver <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.