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

Charles R Harris charlesr.harris at gmail.com
Wed May 21 23:26:34 EDT 2008


On Wed, May 21, 2008 at 9:03 PM, David Cournapeau <
david at 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

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080521/69a149bb/attachment.html>


More information about the NumPy-Discussion mailing list