Root.cpp 432 B

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGC/Cell.h>
  7. #include <LibGC/Heap.h>
  8. #include <LibGC/Root.h>
  9. namespace GC {
  10. RootImpl::RootImpl(Cell* cell, SourceLocation location)
  11. : m_cell(cell)
  12. , m_location(location)
  13. {
  14. m_cell->heap().did_create_root({}, *this);
  15. }
  16. RootImpl::~RootImpl()
  17. {
  18. m_cell->heap().did_destroy_root({}, *this);
  19. }
  20. }