On 10 Feb 2015 13:10, "Antoine Pitrou" <solipsis@pitrou.net> wrote:
>
> On Tue, 10 Feb 2015 11:26:22 -0800
> Nathaniel Smith <njs@pobox.com> wrote:
> > On 10 Feb 2015 09:11, "Antoine Pitrou" <solipsis@pitrou.net> wrote:
> > >
> > >
> > > Hello,
> > >
> > > I apologize for pinging the list, but I was wondering if there was
> > > interest in either of https://github.com/numpy/numpy/pull/5457 (make
> > > array data aligned by default) or
> > > https://github.com/numpy/numpy/pull/5470 (make the array data allocator
> > > configurable)?
> >
> > I'm not a fan of the configurable allocator. It adds new public APIs for us
> > to support, and makes switching to using Python's own memory allocation
> > APIs more complex. The feature is intrinsically dangerous, because newly
> > installed deallocators must be able to handle memory allocated by the
> > previous allocator. (AFAICT the included test case can crash the test
> > process if you get unlucky and GC runs during it?).
>
> It's taken care of in the patch.

Ah, I see -- I missed that you added an allocator field to PyArrayObject. That does reduce my objections to the patch. But I'm still not sure what problems this is solving exactly.

Also, if we do decide to add a deallocation callback to PyArrayObject then I think we should take advantage of the opportunity to also make life easier for c API users who need a custom callback on a case-by-case basis and currently have to jump through hoops using ->base.

-n