Skip to content

Custom allocation for integers #43

@mthom

Description

@mthom

In scryer-prolog I want to allocate integers to a custom garbage-collected arena so that the memory of unreachable (but always immutable) integers and rationals can be implicitly recycled without calling any Drop instance. dashu doesn't currently have a means to customize allocation.

I'd like to submit a PR to add the feature to dashu, likely by elevating MemoryAllocation to a trait whose instance can be specified in the ibig! and ubig! macros among other places, at least until the allocator_api is merged to stable (probably not for a long while yet).

Is this acceptable @cmpute ? Or perhaps there's a way to go about this that I don't know about?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions