• 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: Integrate custom allocators with ObjectAlloc instrument?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrate custom allocators with ObjectAlloc instrument?


  • Subject: Re: Integrate custom allocators with ObjectAlloc instrument?
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Mon, 18 Aug 2008 18:58:27 -0700


On Aug 18, 2008, at 6:18 PM, Ken Thomases wrote:

[T]he ObjectAlloc instrument uses existing hooks in the system to record information about allocation and deallocation events in your application, whether those events originated with the standard system malloc routines or your own custom malloc library.


It doesn't explain the specifics of what it's doing, though. Does that mean that ObjectAlloc relies on the names of the functions "malloc", "calloc", "free", etc.?


The specific motivation for this question regards the Wine project, which implements the Win32 functions (HeapAlloc, etc.) in terms of vm_allocate and/or anonymous mmap regions. However, the question could just as easily apply to custom new/delete operators in C++ and any other custom allocation scheme.

My custom CFAllocator using vm_allocate didn't show up in Shark's malloc trace until I rewrote it as a custom malloc zone (same as NSZone) and registered it. ISTR it didn't show up properly in Instruments, either, so that might help. I used malloc.h and CFBase.c to implement the zone, and the result is at http://code.google.com/p/fileview/source/browse/trunk/fileview/FVAllocator.m (work in progress, BSD licensed).


hth,
Adam

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Integrate custom allocators with ObjectAlloc instrument? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Integrate custom allocators with ObjectAlloc instrument?
  • Next by Date: Can no longer compile for Device SDK: error: IOKit/IOKitLib.h: No such file or directory (amongst other errors)
  • Previous by thread: Integrate custom allocators with ObjectAlloc instrument?
  • Next by thread: Can no longer compile for Device SDK: error: IOKit/IOKitLib.h: No such file or directory (amongst other errors)
  • Index(es):
    • Date
    • Thread