Skip to content

MAINT,TASK: Avoid direct use of malloc #28454

Description

@seberg

We directly call malloc in a few places in NumPy. Overall, and especially historically, this is fine.
However, Python now defaults to mimalloc sometimes and I am not sure we pick that up.

So it would make sense to use PyArray_malloc (or maybe just the PyMem_RawMalloc that it aliases).

In some places using the customizable array allocator could also make sense (I personally don't think it makes sense at least for small temporaries used internally, but there may be some places where the allocation leaks outside of NumPy itself and then it could make sense).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions