Skip to content

Runtime allocators #83

Open
Open
@ivannp

Description

@ivannp

How is the scenario where the allocator is, and can only be, determined at runtime supported? Not too advanced in Rust, so I might be missing something obvious.

I am kind of looking for the equivalent to the C++ 17 polymorphic allocators. In this scenario, the allocator can literally be dropped from the template definition, and it's determined at runtime, via the constructor. This is common scenario in systems using different heaps for different allocations. In these cases, the common scenario is to have a single allocator type, with different runtime configs:

    vector<int> v(my_polimorphic_allocator(theHeap));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions