Re: Please explain the meaning of 'stealing' a ref
From: Michael Hudson (mwh_at_python.net)
Date: 11/04/03
- Next message: John Roth: "Re: duplication of logic"
- Previous message: Edvard Majakari: "Using debug print routine inside assert"
- In reply to: Christos : "Please explain the meaning of 'stealing' a ref"
- Next in thread: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Reply: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 4 Nov 2003 12:32:22 GMT
Christos "TZOTZIOY" Georgiou <tzot@sil-tec.gr> writes:
> I invested some time today because I got this crazy idea that if I
> implemented a simple attribute-getting caching scheme implemented in
> PyObject_GetAttr / PyObject_SetAttr that would turn out to be good.
Are you aware of the cache-attr-branch (think it's called that) in
CVS?
> So I did implement one touching Objects/object.c (and pythonrun.c for
> init/final purposes), and I got a 5% increase in pystone... of course,
> when I exited the interpreter, I got a nice segfault :-) Also,
> test.testall segfaulted at test_anydbm. I didn't expect anything
> better, to be honest; it's obviously got something to do with inc/dec
> refs.
>
> Now I'm googling for the various debug building options (I'm not sure
> that -DDEBUG is enough etc), however I realised it's time to ask what I
> never understood so far: what exactly is the meaning of a function
> "stealing a reference"? Is it that the function does an incref or a
> decref? Or is it something more obscure?
This *really* should be explain in the API reference or the extended
and embedding manual somewhere... have you looked there?
Cheers,
mwh
-- There are two ways of constructing a software design: one way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies. -- C. A. R. Hoare
- Next message: John Roth: "Re: duplication of logic"
- Previous message: Edvard Majakari: "Using debug print routine inside assert"
- In reply to: Christos : "Please explain the meaning of 'stealing' a ref"
- Next in thread: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Reply: Christos : "Re: Please explain the meaning of 'stealing' a ref"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]