rust-lang / wg-allocators

Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!
http://bit.ly/hello-wg-allocators
209 stars 9 forks source link

Add a section to the module documentation "What is a legal allocator" #46

Open TimDiekmann opened 4 years ago

TimDiekmann commented 4 years ago

As noted in https://github.com/rust-lang/wg-allocators/issues/44#issuecomment-596904626, we probably want to add a section in the alloc-module documentation, which describes, what's an legal allocator.

As @Lokathor wrote up, this section

would be similar to how the core::ptr module has a section that describes the pointer validity rules, and how the core::sync::atomic and std::thread modules describe that Rust has some sort of system for threads and atomics and you should go read the C++ specs to learn about it because right now we just do "what llvm does" and that's "what C++ does".

The main rules would be things that "make sense anyway", like you can't start allocating from a location just past the end of the stack and then call a function because when you push stuff onto the stack it starts writing into your allocation pool and the program gets very sad.

TimDiekmann commented 4 years ago

This section in the RFC may be a good start.

TimDiekmann commented 4 years ago

Related: #65