[Numpy-discussion] subclassing array in c

mark florisson markflorisson88@gmail....
Fri Mar 30 12:57:39 CDT 2012


On 29 March 2012 09:07, Christoph Gohle <christoph.gohle@mpq.mpg.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
> Am 08.03.2012 um 20:39 schrieb Pauli Virtanen:
>
>> 08.03.2012 17:37, Christoph Gohle kirjoitti:
>>> thanks for testing. I have now tried on different platforms. I get
>>> all kinds of crashes on os x (now with numpy 1.6.1) and windows
>>> with numpy 1.6.0. On Ubuntu with numpy 1.3.0 I get a hughe memory
>>> leak...
>>>
>>> Any hints would be welcome.
>>
>> The type object inherits `tp_alloc` from Numpy. This routine always
>> allocates memory of size NPY_SIZEOF_PYARRAYOBJECT for the
>> PyArrayObject. Therefore, the write to new->unit in your
>> __array_finalize__ goes to unallocated memory.
> do you think, I should submit a bugreport?
>
> Cheers,
> Christoph
>

Although the segfault was caused by a bug in NumPy, you should
probably also consider using Cython, which can make a lot of this pain
and boring stuff go away.

> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
>
> iEYEARECAAYFAk90GEQACgkQLYu25rCEIztHGwCgi4asYpscBFYp6yfYAc1wioZG
> 9EAAoIZft1WOiiAj+cyJi+RVuT2U7BzF
> =e9cn
> -----END PGP SIGNATURE-----
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion


More information about the NumPy-Discussion mailing list