[C++-sig] Reference counted object return value policy

Jean-Sébastien Guay jean-sebastien.guay at cm-labs.com
Wed Sep 24 15:32:12 CEST 2008


Hello Hans,

>> * I don't know when such and such strategy is required, and when it's
>>    just useless code that adds to the maintenance overhead of my wrappers
> 
> My strategy for preventing useless code usually is to leave out as much code 
> as possible and see what breaks (not).

That's what I've been doing until now, but it doesn't seem that successful.

> AFAIK, yes.  But I have nearly zero experience with that.  I occasionally run 
> python through valgrind (with the supplied suppressions-file) in order to 
> find memleaks/similar memory errors though.  It's slow, but works fairly 
> well.

I'm not talking about memory leaks per se, I'm talking about the actual 
wrapper code causing crashes of the interpreter. I've seen a few 
instances of choosing the wrong return value policy making the 
interpreter crash, and I don't see a way of finding out what code was 
being called to cause the crash.

Anyways, I'll read up on the actual low-level process that's going on 
and hopefully that will help me understand what I'm doing.

Thanks,

J-S
-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.guay at cm-labs.com
                                http://www.cm-labs.com/
                         http://whitestar02.webhop.org/



More information about the Cplusplus-sig mailing list