Custom memory allocation like C++?

Does Rust have the ability to do custom memory allocation for purposes of performance optimization, like C++ does? In other words can you get a raw block of memory and construct objects at specific addresses? Or memory map something and use it as if the objects are already there, constructed, without actually running constructors and destructors?

(I'm new and learning about the language, to see if I want to use it for a certain project.)

Yes. The bumpalo crate works in that way.

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.