Skip to content

Allocation Semantics #142

@qinsoon

Description

@qinsoon

Allocation semantics are a set of properties that an object may have. This is a replacement of the current enum Allocator (which also helps avoid confusion of the name Allocator). Allocation semantics are like UNIX file attributes. You can or those flags/semantics.

Each space defines the semantics for objects in it. For example, all objects in an immortal space are non-moving. Pinned objects in certain spaces are non-moving.

A plan defines how to map allocation semantics to the actual allocators (which further map to spaces). The plan implementer needs to provide a complete mapping for all the combinations of allocation semantics (though he may use fallback, or simply fail on certain allocation semantics).

Two APIs are related with this:

  • alloc(..., semantics) -> object: uses the mapping defined by the plan to allocate object
  • has_semantic(object, semantics) -> bool: uses the semantics defined by the space to determine if the object has those semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions