Skip to content

Missing gettag #104

Description

Although gentag and settag may be sufficient for malloc, heaps that perform iteration (for example, sweeping) need a gettag to create valid object pointers. Otherwise the heap would need to redudantly store the tags.

HeapPage::VisitObjects(ObjectVisitor* visitor) {
  const uintptr_t start = this->object_start();
  const uintptr_t end = this->object_end();
  uintptr_t scan = start;
  while (scan < end) {
    HeapObjectPtr obj = static_cast<HeapObjectPtr>(scan | gettag(scan));
    visitor->VisitObject(obj);
    scan += obj->HeapSize();
  }
}

Note that aarch64 provides ldg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions