Restructured and rewritten entire codebase

This commit is contained in:
Alex
2023-10-09 01:16:24 +03:00
parent 446a571018
commit 889e1522a3
484 changed files with 15683 additions and 14032 deletions

View File

@ -0,0 +1,25 @@
#include <memory.hpp>
namespace Memory
{
SmartHeap::SmartHeap(size_t Size, VirtualMemoryArea *vma)
{
if (vma)
{
this->vma = vma;
this->Object = vma->RequestPages(TO_PAGES(Size));
}
else
this->Object = kmalloc(Size);
this->ObjectSize = Size;
memset(this->Object, 0, Size);
}
SmartHeap::~SmartHeap()
{
if (this->vma)
this->vma->FreePages(this->Object, TO_PAGES(this->ObjectSize));
else
kfree(this->Object);
}
}