4 ms·
> There are some standard library features that provide and work with heap allocators, but those are optional standard library features, not built into the lang
by oconnor663 8y ago
> There are some standard library features that provide and work with heap allocators, but those are optional standard library features, not built into the language itself.
Note that this is also true of Rust. Programs build using `no_std` and `libcore` don't have an allocator. A surprising amount of functionality is still available, like sorting and string splitting.
- nicoburns 8y agoYes, but zig takes it a step further by allowing you to pass a heap allocator into the standard array/vector type. There are discussions about implementing something similar in Rust, but it doesn't exist yet...
- frutiger 8y agoC++17 allows that too with all the containers in the std::pmr namespace.