Skip to content

Use the MarkState in ImmixSpace and LOS #1511

Description

@wks

Work items:

  • Let ImmixSpace, LargeObjectSpace and MarkSweepSpace use MarkState for marking
  • Let MarkState use AtomicU8 internally, removing the need to use &mut self to flip the mark state
  • (optional) Let MarkSweepSpace implement cyclic mark bits.

Currently the MarkState implements cyclic mark state for ImmortalSpace and VMSpace. But both ImmixSpace and LargeObjectSpace reinvent the wheel, i.e. they implement the mark states in their own fields. The native MarkSweepSpace for some reasons doesn't use cyclic mark states.

And the re-inveneted mark_state: u8 field is one field that needs to be modified in prepare or release, and it is one of the reasons why fn prepare and fn release have to have the &mut self parameter instead of &self.

We should use the MarkState struct for the mark bit and not reinvent the wheel.

To address the "uniqueness of &mut Plan" problem mentioned in #852 (comment), MarkState should internally use AtomicU8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions