Skip to content

Support Arena Allocators #1095

@BennoLossin

Description

@BennoLossin

The current proposal for our own allocator trait does not support carrying allocator information (ie the methods do not take &self but are free standing functions). This prevents implementation of arena allocators, as they carry the space that can be allocated.

The reason that the current proposal has this limitation is #[derive(SmartPointer)]: it can only be used on repr(transparent) structs, preventing a non-ZST allocator: A field. The problem of allowing non-repr(transparent) structs under #[derive(SmartPointer)] is a complex one, see rust-lang/rfcs#3621. But it might eventually be possible to do so. This issue tracks if/when it is possible to change the allocator trait to accommodate arena allocators (and other stateful allocators).

cc @dakr

Metadata

Metadata

Assignees

No one assigned

    Labels

    • libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions