Skip to content

Allow passing custom memory management functions #704

Open
@caspervdw

Description

@caspervdw

Providing custom memory management functions would allow dependent libraries to use their memory management policies. Especially when small amount of bytes are repeatedly allocated/deallocated, caching/pooling may show a decent speedup.

Also out-of-memory situations may be handled more gracefully (specifically for pygeos/shapely, we could throw an error instead of going in to swap, see shapely/shapely#1349)

Ref. https://trac.osgeo.org/geos/ticket/540

One way to set up such a C interface is well described in the Numpy docs (NEP49): https://numpy.org/neps/nep-0049.html and another one in the Python docs: https://docs.python.org/3/c-api/memory.html#memoryoverview

@jorisvandenbossche @hobu

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or feature improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions