Skip to content

Proof Of Concept Crate: Simplistic Bump Allocator #71

Open
@Lokathor

Description

@Lokathor

Many groups want a simple "bump allocator" which can be used for per-frame data.

This should be sufficiently simple to setup and also maintain safety.

  • The bump alloc has a pile of data and an "alloc count"
  • When you allocate out of it you get a BumpBox or BumpSlice<[T]> or possibly other types. Optionally we can allow allocation failures here.
  • When any of the BumpBox and friends types drop they know to decrease the alloc count. This could be done via Rc or Arc, or via having a single global bump allocator with an atomic counter that they know to go and edit, or whatever way.
  • You can call reset on the allocator to reset the allocator to the start of the data pile.
  • If the number of allocations checked out when you call reset is non-zero, it panics.

What we need is a proof of concept crate so that we can test it out, find the problems, iterate design, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Crate RequestA requested crate to help improve the ecosystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions