Integrate custom allocators with ObjectAlloc instrument?
Integrate custom allocators with ObjectAlloc instrument?
- Subject: Integrate custom allocators with ObjectAlloc instrument?
- From: Ken Thomases <email@hidden>
- Date: Mon, 18 Aug 2008 20:18:25 -0500
Hi,
Is there a way to integrate custom allocators with the ObjectAlloc
instrument?
I'm thinking of two possible approaches:
1) a set of functions that my custom allocator could call to inform
ObjectAlloc of my allocations
2) a way to tell ObjectAlloc about my custom allocate, deallocate,
and reallocate function names so that it would hook into them itself
If it helps, I'm fairly familiar with DTrace, although I haven't yet
written any USDT probes.
The "Analyzing Data with the ObjectAlloc Instrument" section of the
Instruments User Guide[1] has this tantalizing sentence:
[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.
Thanks,
Ken
[1] http://developer.apple.com/documentation/DeveloperTools/
Conceptual/InstrumentsUserGuide/ViewingandAnalyzingData/
chapter_6_section_3.html#//apple_ref/doc/uid/TP40004652-CH5-SW23
_______________________________________________
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