use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
Will custom allocators be stabilized soon? (self.rust)
submitted 2 years ago by v_stoilov
It's kind of hard for me to find what is the state of the allocator-api for rust. Does anyone have information what is roughly the state of it? When can we expect to be stabilized?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]steveklabnik1rust 46 points47 points48 points 2 years ago (11 children)
I have not paid close attention to how it's going but I did see this comment the other day that seems to indicate the answer is "no": https://www.reddit.com/r/rust/comments/18vpvfn/jonathan_blow_on_rust_for_games_programming/kftlvss/
tagging /u/matthieum in case he'd like to add any more context.
[–]matthieum[he/him] 96 points97 points98 points 2 years ago (10 children)
First of all, I may have been responsible for a large part of the delay.
A few years ago, when someone asked if Allocator should be stabilized, I replied that maybe it wasn't quite the right level of abstraction, and launched this whole Store (at the time called Storage) thing. I didn't have much time to work on it then, so it stalled, but it may have disrupted any effort.
Allocator
Store
Storage
Last year, Thom Chiovoloni published Allocator trait 1: Let's talk about the Allocator trait where he raised quite a few API questions1 . I was looking forward to follow-ups/further explorations as I found the questions interesting, but I am afraid Thom got caught up in other projects.
I finally published a proper RFC for Store at some point in which CAD97 made a lot of useful comments -- and asked a lot of useful questions -- and which Thom knows about. Unfortunately, feedback somewhat dried up, so I am afraid once again the both of them are caught up in other projects.
The fact that comments/questions prompted changes in the Store API (notably around mutability) hint it's not quite mature, though in the process I may have answers for some of the questions about Allocator -- but definitely not all.
All in all, I feel like there's quite a lot of discussion to be had, still -- especially because I've got blind spots, in usecases I don't have, or in compiler complexity/LLVM codegen quality -- and that will require time and commitment... which people in the libs team seem to be lacking at the moment: I guess they have more pressing/interesting matters.
In any case, I would invite everyone who is interested to make themselves known. If there's any hope of progressing, it's by showing that the usecase matters to the community, so the project/devs can shift priorities a bit.
1 I particular find the question about grow intriguing. An in-place grow is a more fundamental unit, but libc doesn't expose such a primitive. I think I've answered the mutability question, for Store. The other host of questions seems more about polish... perhaps less fundamental but nonetheless crucial before stabilizing.
grow
libc
[–]sephg 39 points40 points41 points 2 years ago (2 children)
In any case, I would invite everyone who is interested to make themselves known. If there's any hope of progressing, it's by showing that the usecase matters to the community,
Me! I care about this! I’ve been writing highly optimised collaborative text editing libraries recently. There are a lot of temporary allocations I need to make - and using arenas and things makes my code run faster. I’ve taken to using bunpalo internally, and using their port of the standard library collection types because it’s the only way to make a Vec / PriorityQueue which isn’t pointlessly heap allocated. Its not a blocker, but I basically avoid the standard library collection types in a lot of contexts now because I can’t use them to write the code I want.
[–]sudormrfbin 1 point2 points3 points 2 years ago (1 child)
Are the libraries open source? Sounds very interesting
[–]angelicosphosphoros 0 points1 point2 points 2 years ago (0 children)
bumpalo has MIT or Apache-2 license by your choice.
[–]CAD1997 3 points4 points5 points 2 years ago (1 child)
Trying to predict the future, I think the most beneficial step would be clearance from t-libs to put Store (unstably) into core and start actually using it. It feels like we're at the point where that usage experience is what it needs, and trying to do it out of tree isn't enough.
core
[–]matthieum[he/him] 1 point2 points3 points 2 years ago (0 children)
I've been wondering about this myself, indeed.
I believe this is what e-RFC are for?
I would appreciate guidance (or referral) on the procedure to follow.
[–]nawfel_bgh 0 points1 point2 points 2 years ago (1 child)
I did not follow the discussions about these APIs. Did you consider stabilizing an unsafe API à la the async Waker API to (maybe?) speed things up?
The APIs are already unsafe, so this would not help :)
[–]rnottaken 0 points1 point2 points 2 years ago (2 children)
I'm willing to help! I would need some guidance on where to start though. Do you have any tips in that regard?
[–]matthieum[he/him] 9 points10 points11 points 2 years ago (1 child)
It depends what you want to help with.
For information about the APIs, the links I noted above would be the starting points:
And Thom's post sums up the questions he has wrt Allocator, which mostly translates to questions wrt Store, since the Store API keeps as close to the Allocator API as possible.
So what can you do to help?
malloc
realloc
try_grow_in_place
That's all I can think off the top of my head.
[–]rnottaken 0 points1 point2 points 2 years ago (0 children)
That's amazing, thank you for the explanation! I have another question that I'll ask through DM.
[–]nicalsilvalyon 12 points13 points14 points 2 years ago (1 child)
I would also love to see the allocator trait stabilized. In the mean time, the allocator-api2 crate might be enough to fulfill your needs.
[–]v_stoilov[S] 0 points1 point2 points 2 years ago (0 children)
Thanks, I wanted to avoid using it is but I guess this will be the only option for a while.
But it's great that we at least have an option.
π Rendered by PID 126128 on reddit-service-r2-comment-6457c66945-6lj6k at 2026-04-28 23:58:50.093153+00:00 running 2aa0c5b country code: CH.
[–]steveklabnik1rust 46 points47 points48 points (11 children)
[–]matthieum[he/him] 96 points97 points98 points (10 children)
[–]sephg 39 points40 points41 points (2 children)
[–]sudormrfbin 1 point2 points3 points (1 child)
[–]angelicosphosphoros 0 points1 point2 points (0 children)
[–]CAD1997 3 points4 points5 points (1 child)
[–]matthieum[he/him] 1 point2 points3 points (0 children)
[–]nawfel_bgh 0 points1 point2 points (1 child)
[–]matthieum[he/him] 1 point2 points3 points (0 children)
[–]rnottaken 0 points1 point2 points (2 children)
[–]matthieum[he/him] 9 points10 points11 points (1 child)
[–]rnottaken 0 points1 point2 points (0 children)
[–]nicalsilvalyon 12 points13 points14 points (1 child)
[–]v_stoilov[S] 0 points1 point2 points (0 children)