• 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: Documentation on Guard Malloc system level interface?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation on Guard Malloc system level interface?


  • Subject: Re: Documentation on Guard Malloc system level interface?
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 9 Jan 2011 02:18:05 -0600

On Jan 9, 2011, at 1:04 AM, Yuri wrote:

> On 01/08/2011 16:51, Ken Thomases wrote:
>>> I know Guard Malloc has the capability to capture all memory allocations and doesn't require other libraries to be explicitly linked to it.
>>> >  Herehttp://developer.apple.com/library/mac/#documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html  is its user-side interface.
>>> >  Where can I find its system-side interface? How does it get malloc calls?
>>>
>> It's not "capturing" memory allocations.  It "gets" malloc calls by being the malloc library.  It is directly called by anything trying to allocate memory.  The documentation you linked to explains it:
>>
>> "Guard Malloc is a special version of the malloc library that replaces the standard library during debugging."
>>
>
> Guard Malloc has different interface compared to libSystem.B.dylib. For example, libSystem.B.dylib exports malloc symbol, and libgmalloc.B.dylib imports it.
> Hence was my question: what is the system interface of libgmalloc.B.dylib? How exactly does libgmalloc.B.dylib is being plugged in to be a malloc library?

It's using "DYLD interposing" to substitute its own functions in place of the malloc functions of libSystem.  DYLD interposing of system APIs is pretty much impractical for anybody but Apple to use, since it is sensitive to exact symbol locations, which can change with any system update.

Regards,
Ken

 _______________________________________________
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: Documentation on Guard Malloc system level interface?
      • From: Yuri <email@hidden>
References: 
 >Documentation on Guard Malloc system level interface? (From: Yuri <email@hidden>)
 >Re: Documentation on Guard Malloc system level interface? (From: Ken Thomases <email@hidden>)
 >Re: Documentation on Guard Malloc system level interface? (From: Yuri <email@hidden>)

  • Prev by Date: Re: Why isn't Interface Builder showing any classes from my project?
  • Next by Date: Re: Why isn't Interface Builder showing any classes from my project?
  • Previous by thread: Re: Documentation on Guard Malloc system level interface?
  • Next by thread: Re: Documentation on Guard Malloc system level interface?
  • Index(es):
    • Date
    • Thread