mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +00:00
Kernel: Make Heap implementation reusable, and make kmalloc expandable
Add an ExpandableHeap and switch kmalloc to use it, which allows for the kmalloc heap to grow as needed. In order to make heap expansion to work, we keep around a 1 MiB backup memory region, because creating a region would require space in the same heap. This means, the heap will grow as soon as the reported utilization is less than 1 MiB. It will also return memory if an entire subheap is no longer needed, although that is rarely possible.
This commit is contained in:
@@ -60,7 +60,7 @@ Thread::Thread(NonnullRefPtr<Process> process)
|
||||
dbg() << "Created new thread " << m_process->name() << "(" << m_process->pid().value() << ":" << m_tid.value() << ")";
|
||||
#endif
|
||||
set_default_signal_dispositions();
|
||||
m_fpu_state = (FPUState*)kmalloc_aligned(sizeof(FPUState), 16);
|
||||
m_fpu_state = (FPUState*)kmalloc_aligned<16>(sizeof(FPUState));
|
||||
reset_fpu_state();
|
||||
memset(&m_tss, 0, sizeof(m_tss));
|
||||
m_tss.iomapbase = sizeof(TSS32);
|
||||
|
||||
Reference in New Issue
Block a user