• 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: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?


  • Subject: Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
  • From: Yuri <email@hidden>
  • Date: Sat, 15 Jan 2011 18:26:42 -0800

On 01/15/2011 17:36, Ken Thomases wrote:
On Jan 15, 2011, at 6:31 PM, Yuri wrote:

On 01/15/2011 16:08, Jonas Maebe wrote:
See http://blogs.embarcadero.com/eboling/2010/02/16/5656/#comment-77

But I don't see why the lack of flat namespace causes memory allocator to not recognize the memory block. Is libSystem.B.dylib actually instantiated twice somehow?
I'm guessing that there's an object allocated with one operator new and deallocated with the operator delete which doesn't match.  The two probably don't agree on what the base pointer is.  For example, one of the implementations may take the pointer returned from malloc and add an offset to it so it can store some bookkeeping data "before" the object.  The corresponding operator delete would subtract that offset to get the malloc'd pointer back given the object pointer.  If the other pair of operators doesn't do exactly the same thing (and there's no reason to expect they would), then you can't mix and match them.

(There's also the distinct possibility that one pair of operators uses a sub-allocation strategy.)

Regards,
Ken


No, the only global operator new and operator delete present in the system is just equivalent to malloc/free.


Yuri
_______________________________________________
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


  • Follow-Ups:
    • Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
      • From: Jonas Maebe <email@hidden>
References: 
 >Why do I get the message 'pointer being freed was not allocated' in my dynalib? (From: Yuri <email@hidden>)
 >Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib? (From: Jonas Maebe <email@hidden>)
 >Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib? (From: Yuri <email@hidden>)
 >Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
  • Next by Date: Purchase one app from another app
  • Previous by thread: Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
  • Next by thread: Re: Why do I get the message 'pointer being freed was not allocated' in my dynalib?
  • Index(es):
    • Date
    • Thread