Skip to content

What about AllocRef and SyncAllocRef? #71

Closed
@lachlansneff

Description

@lachlansneff

I feel like this would provide the most ergonomic solution for working with both single-threaded and multi-threaded collections.

For a stack allocator, you'd pass &mut A into the collection. For a collection like a shared hashmap, you'd use an allocator that supported concurrent allocations and pass in &A. AllocRef would be implemented for either &A and &mut A depending on if it was concurrent or not.

It's definitely possible I'm not seeing some downsides of this, but it seems like the best of both worlds to me.

See my reply lower down.

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