[Numpy-discussion] Fix to #789 maybe not right.

Charles R Harris charlesr.harris@gmail....
Wed May 21 22:26:34 CDT 2008

On Wed, May 21, 2008 at 9:03 PM, David Cournapeau <
david@ar.media.kyoto-u.ac.jp> wrote:

> Charles R Harris wrote:
> >
> >
> > And I'm not sure self->desc needs its reference count decremented,
> > PyArray_FromArray is one of those vicious, nasty functions with side
> > effects and might decrement the count itself.
> might ? What do you mean by might decrement ? If the call to
> PyAarray_FromArray fails, no reference are stolen, right ?

Maybe, maybe not. We need to look at the function and document it. I think
these sort of functions are an invitation to reference counting bugs, of
which valgrind says we have several. Really, all the increments and
decrements should be inside PyArray_FromArray, but calls to this function
are scattered all over.

> > Note that the reference count is not decremented elsewhere. It's a
> > capital offense to write such functions, but there it is.
> >
> > On a lesser note, there is trailing whitespace on every new line
> > except one.
> This is easier to fix :)

Not that I think we are in any worse shape after the fix than before, but I
do think we should pretty much leave things alone until 1.1 out the door and
leave future fixes to 1.1.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080521/69a149bb/attachment-0001.html 

More information about the Numpy-discussion mailing list