Skip to content

Safety comment on Allocator trait likely incorrect #107040

Closed
@programmerjake

Description

@programmerjake

one of the safety requirements for the Allocator trait is:

/// * 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

No one assigned

    Labels

    A-allocatorsArea: Custom and system allocatorsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions