VMObject.cpp 457 B

123456789101112131415161718192021
  1. #include <Kernel/FileSystem/FileSystem.h>
  2. #include <Kernel/FileSystem/Inode.h>
  3. #include <Kernel/VM/MemoryManager.h>
  4. #include <Kernel/VM/VMObject.h>
  5. VMObject::VMObject(const VMObject& other)
  6. : m_physical_pages(other.m_physical_pages)
  7. {
  8. MM.register_vmobject(*this);
  9. }
  10. VMObject::VMObject(size_t size)
  11. : m_physical_pages(ceil_div(size, PAGE_SIZE))
  12. {
  13. MM.register_vmobject(*this);
  14. }
  15. VMObject::~VMObject()
  16. {
  17. MM.unregister_vmobject(*this);
  18. }