-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
one of the safety requirements for the Allocator
trait is:
rust/library/core/src/alloc/mod.rs
Lines 97 to 99 in a28f3c8
/// * Memory blocks returned from an allocator must point to valid memory and retain their validity | |
/// until the instance and all of its clones are dropped, | |
/// |
afaict that's incorrect since, because of the validity requirements, it requires Allocators to never free any memory blocks until the Allocator and all clones are dropped.
It should instead be something like:
/// * Memory blocks returned from an allocator that are [*currently allocated*] must point to
/// valid memory and retain their validity while they are [*currently allocated*] and at
/// least one of the instance and all of its clones has not been dropped.
Metadata
Metadata
Assignees
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools