From: Sven C. K. <sc...@sn...> - 2001-08-20 10:19:13
|
On Mon, Aug 20, 2001 at 11:56:54AM +0200, Helge Hess wrote: > As long as ObjC objects are concerned Boehm GC *does* use typed memory > and is exact ! It only needs to guess on stack and global variables. > While it may not find all leaks it will find 99.99% of the leaks. Cool! > > One could read the return address from the stack, and translate it > > afterwards via binutils's addr2line program, but that's very evil! > > More important: it's very slow which makes it unusable. You can get the > callee information in the RETAIN macros, but even then tracking all RC > owners will be a huge memory problem ! > > #define RETAIN(x) \ > [x retainFromFunction:__PRETTY_FUNCTION__ \ > file:__FILE__ line:__LINE__]; I am afraid, my source code doesn't use the RETAIN et al. macros like lF does. So, bascially I would wrap retain et al., and write the callees address and the address of the object to retain to a logfile. Afterwards, I would read the logfile with a script and search for retain cycles. Then I would translate all the callee addresses that are part of cycles to line numbers via addr2line or using a generated addresses map to speed up processing. But I think this scenario is pretty fictional, since I hope GCObject will do this already for me. Regards, Sven |