• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UB issue -- include order?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UB issue -- include order?


  • Subject: Re: UB issue -- include order?
  • From: Eric Albert <email@hidden>
  • Date: Sat, 18 Mar 2006 13:46:09 -0800

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>)

  • Prev by Date: Re: Syntax Coloring?
  • Next by Date: Unexplained multiply defined _powf, _sinf, etc warnings
  • Previous by thread: Re: UB issue -- include order?
  • Next by thread: Re: UB issue -- include order?
  • Index(es):
    • Date
    • Thread