generational-arena

A safe arena allocator that allows deletion without suffering from the ABA problem by using generational indices. (by fitzgen)

Generational-arena Alternatives

Similar projects and alternatives to generational-arena

  1. rust

    Empowering everyone to build reliable and efficient software.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. go

    The Go programming language

  4. Lobsters

    Computing-focused community centered around link aggregation and discussion

  5. Protobuf

    Protocol Buffers - Google's data interchange format

  6. TablaM

    The practical relational programing language for data-oriented applications

  7. bumpalo

    A fast bump allocation arena for Rust

  8. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  9. goprotobuf

    Go support for Google's protocol buffers (by golang)

  10. protobuf-go

    Go support for Google's protocol buffers

  11. hecs

    A handy ECS

  12. lobsters-ansible

    Ansible playbook for lobste.rs

  13. pointer-utils

    A collection of small utilities for working with pointer types in Rust.

  14. gapid

    Graphics API Debugger

  15. vec-tree

    A safe tree using an arena allocator that allows deletion without suffering from the ABA problem by using generational indices. https://docs.rs/vec-tree/0.1.0/vec_tree/

  16. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better generational-arena alternative or higher similarity.

generational-arena discussion

Log in or Post with

generational-arena reviews and mentions

Posts with mentions or reviews of generational-arena. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-12-24.
  • Four limitations of Rust's borrow checker
    6 projects | news.ycombinator.com | 24 Dec 2024
    I tend to agree w.r.t. managed languages.

    Still, being free from GC is important in some domains. Beyond being able to attach types to scopes via lifetimes, it also provides runtime array bounds checks, reference-counting shared pointers, tagged unions, etc. These are the techniques used by managed languages to achieve memory-safety and correctness!

    For me, Rust occupies an in-between space. It gives you more memory-safe tools to describe your problem domain than C. But it is less colloquially "safe" than managed languages because ownership is hard.

    Your larger point with indices is true: using them throws away some benefits of lifetimes. The issue is granularity. The allocation assigned to the collection as a whole is governed by rust ownership. The structures you choose to put inside that allocation are not. In your user ID example, the programmer of that system should have used a generational arena such as:

    https://github.com/fitzgen/generational-arena

    It solves exactly this problem. When you `free` any index, it bumps a counter which is paired with the next allocated index/slot pair. If you want to avoid having to "free" it manually, you'll have to devise a system using `Drop` and a combination of command queues, reference-counted cells, locks, whatever makes sense. Without a GC you need to address the issue of allocating/freeing slots for objects within in an allocation in some way.

    Much of the Rust ecosystem is libraries written by people who work hard to think through just these types of problems. They ask: "ok, we've solved memory-safety, now how can we help make code dealing with this other thing more ergonomic and correct by default?".

  • Is Rust suitable for representing domain concepts?
    1 project | /r/rust | 17 Apr 2023
    In my experience it is often easier to use indexes instead of copying Rc's. If you want to mutate the graph, then look in to slab and generational-arena
  • My thoughts on Rust for game development
    1 project | /r/rust_gamedev | 29 Mar 2023
    Regarding ECS: yes, but in a deflationary sense. The game has entities, stored in something very similar to GenerationalArena, and it has "systems", which are just functions that operate on these entities. The components themselves are just fields of the Entity megastruct. Having an ECS in the narrow sense doesn't really make a lot of sense for this game, because a lot of its rules are dependent on each other, and there's very little chance to extract parallelism. Also, even the current largest levels have less than 10k entities, so simulation performance is not a bottleneck yet.
  • Freeing slice without knowing it’s size
    2 projects | /r/rust | 11 Jul 2022
    If you cannot inplace construct the slice-dst on heap and your slice is too large to be copied, then I think there are two solutions: - Using Box>, this adds another level of indirection but avoids the copying - Use an arena like slotmap, slab, generational_arena or concurrent_arena to store the Box<[u8]>. It still needs heap allocation, but it allocates in chunks, thus less fragmentation and performs better.
  • Is there an abstract technical name for a map that generates its own keys??
    1 project | /r/learnprogramming | 22 Jul 2021
    I think this is less of a good fit though: the word "arena" doesn't imply iteration is possible to me. I think arenas also conventionally will reuse previously-released handles (unless you implement akin to a generational arena), so the term might be a bit misleading in that regard.
  • Mutability with Arenas?
    2 projects | /r/rust | 14 Jul 2021
    Might wanna check out https://github.com/fitzgen/generational-arena / https://github.com/ArnaudValensi/vec-tree/blob/master/tests/tests.rs.
  • A new ProtoBuf generator for Go
    7 projects | news.ycombinator.com | 3 Jun 2021
    This is far from the only arena allocator written in Rust.

    From the same author, a zero-unsafe arena allocator: https://github.com/fitzgen/generational-arena

    There are many, many arena implementations available with varying characteristics. It's disingenuous to act like Rust requires the author of an arena library to write "unsafe" everywhere.

  • Automatic Struct of Array generation for Rust
    2 projects | /r/rust | 2 May 2021
    If someone wants to adapt it to create computergames, then it would probably be useful to find a way to introduce generational generational indexes
  • A note from our sponsor - SaaSHub
    www.saashub.com | 26 Mar 2025
    SaaSHub helps you find the best software and product alternatives Learn more →

Stats

Basic generational-arena repo stats
8
646
0.0
over 1 year ago

Sponsored
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai

Did you know that Rust is
the 5th most popular programming language
based on number of references?