Skip to content

Roadmap #48

Description

@TimDiekmann

I would like to come to the listed issues in the more or less indicated order. Linked issues are not necessarily confirmed, please consult the issues for more details.

AllocRef:

Allocator aware types:

GlobalAlloc:

Documentation:

Other:

Activity

  1. self-assigned this
    on Mar 12, 2020
  2. pinned this issue on Mar 12, 2020
  3. TimDiekmann commented on Mar 28, 2020

    @TimDiekmann
    ContributorAuthor

    Updated OP.

  4. Wodann commented on Apr 25, 2020

    @Wodann

    @TimDiekmann what are next steps? Are we waiting for potential feedback from users on our changes to the API before we proceed?

  5. TimDiekmann commented on Apr 25, 2020

    @TimDiekmann
    ContributorAuthor

    I'm currently testing the API with alloc-compose. I also testing out, on how well taking &self is working. While most allocators could use &self instead of &mut self this has a major downside: Cell is !Sync, so using internal mutability for Sync allocators have to use atomics or other structs, which introduce more overhead. For the same reason, Bump from bumpalo is also !Sync.

  6. Amanieu commented on Apr 25, 2020

    @Amanieu
    Member

    I think those downside of &self are actually advantages, see #55.

  7. SimonSapin commented on Apr 26, 2020

    @SimonSapin
    Contributor
    • deprecate GlobalAlloc

    Actively emitting deprecation warnings causes churn. What benefit does this bring in exchange?

    • add #[doc(hidden)] to GlobalAlloc

    GlobalAlloc is stable, so there will always be legacy code that uses it (even if with deprecating warnings). Hiding its docs would be confusing to future readers of such code, for what benefit? Compared to documenting that using AllocRef instead is preferred.

  8. TimDiekmann commented on Apr 26, 2020

    @TimDiekmann
    ContributorAuthor

    Isn't that the point of deprecation warnings? Error::source was introduced in 1.30, Error::cause was deprecated in 1.33. I expect many more people to use the Error trait than the GlobalAlloc trait. Sure, we could also just leave GlobalAlloc alone 🙂

    Hiding its docs would be confusing to future readers of such code

    Fair point.

  9. Wodann commented on Aug 5, 2020

    @Wodann

    @TimDiekmann Could you update the roadmap with recent changes and what's left for us to do?

    Also, can we proceed with #7 now that unstable generic trait instantiations are supported?

  10. changed the title [-]Roadmap for `AllocRef`[/-] [+]Roadmap[/+] on Aug 5, 2020
  11. TimDiekmann commented on Aug 5, 2020

    @TimDiekmann
    ContributorAuthor

    Updated the roadmap.

    Also, can we proceed with #7 now that unstable generic trait instantiations are supported?

    rust-lang/rust#72314 is not merged yet as @varkor asked for a few more tests. I will open a new issue for each collection when it's merged.

  12. Wodann commented on Aug 5, 2020

    @Wodann

    Thanks for cleaning up the roadmap and outstanding issues 👍

  13. TimDiekmann commented on Oct 3, 2020

    @TimDiekmann
    ContributorAuthor

    @Wodann FYI: We have started to implement #7.

  14. berkus commented on Dec 7, 2020

    @berkus

    Should AllocRef be renamed Allocator now or it's a different AllocRef?

  15. TimDiekmann commented on Dec 7, 2020

    @TimDiekmann
    ContributorAuthor
  16. MarinPostma commented on Dec 20, 2023

    @MarinPostma

    Hey I see that the last message in this issue is 3yo, what's the current status? Is there any way to get involved and help move the needle a bit?

  17. yanchith commented on Mar 23, 2024

    @yanchith

    @MarinPostma If you use nightly, allocators are very much usable already (and have been since 2021-ish). I figure most people that need allocators already use them, and you can too.

    You can make your own allocators and your own allocator-aware collections, and these days even most of alloc/std collections already work custom allocators (#7), with String being the notable holdout (there's a history of attempts to make it happen, current HEAD here rust-lang/rust#101551).

    Regarding allocators on stable: if you look at issues in this repository, you'll see we are still a long way off. Personally, I'd want to have some kind of MVP stabilized sooner, possibly at the expense of completely resolving questions such as #15.

    Regarding involvement: I don't know of any easy things that need doing. #7 was such a list, but fruit has been picked.

  18. wmmc88 commented on Mar 29, 2024

    @wmmc88

    Regarding allocators on stable: if you look at issues in this repository, you'll see we are still a long way off.

    As a stopgap, I've seen many people adopt the use of https://github.com/zakarumych/allocator-api2 to get these apis in stable. This includes larger crates like hashbrown

  19. jmillikin commented on May 22, 2024

    @jmillikin

    In the spirit of seeking an MVP, is there anything blocking the stabilization of the "required" subset of core::alloc::Allocator?

    For example, consider an Allocator with only two methods: allocate() and deallocate(). Are there any compatibility or stability concerns with stabilizing those two, and then leaving the optional methods for later?

    pub unsafe trait Allocator {
        fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>;
    
        unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout);
    }

    The goal here would be to enable use of Allocator with third-party crates that do their own alloc management, e.g. for arenas or custom Box-like types.

  20. yanchith commented on Jul 29, 2025

    @yanchith

    Like @jmillikin, I'd also like to see minimal subset stabilized, although my minimal subset is a little larger:

    As a user of allocator_api, I'd be quite happy with stabilizing a min_allocator_api with:

    • The Allocator trait as is (except maybe Allocator::by_ref, but maybe I just don't understand what it is for).
    • The allocator type parameter on std collections. I think this is almost implemented and the only critical thing missing is String<A>.
    • Nothing else: no vec_in!, DefaultIn, collect_in, etc. The reasoning here is that if someone really needs custom allocators for better speed/memory, they will be okay without all these helpers. Additionally, I'd argue that in codebases where performance is important, these helpers obscure what is going on.

    Anyway, the current allocator_api + String<A> would already be very useful to a lot of people.

    Can some of the workgroup members and designers here comment on they think is needed?

  21. DemiMarie commented on Mar 12, 2026

    @DemiMarie

    Yes please.

    Enough time has passed, let’s get this merged.

  22. unpinned this issue on Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions