mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
[libc] Implement sbrk to allow malloc() to work
Userspace can now allocte via malloc. This is slightly janky because it relies on a single static handle in the library code.
This commit is contained in:
@@ -71,6 +71,7 @@ vm_space::add(uintptr_t base, vm_area *area)
|
||||
//TODO: check for collisions
|
||||
m_areas.sorted_insert({base, area});
|
||||
area->mapper().add(this);
|
||||
area->handle_retain();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,6 +82,7 @@ vm_space::remove(vm_area *area)
|
||||
if (a.area == area) {
|
||||
m_areas.remove(a);
|
||||
area->mapper().remove(this);
|
||||
area->handle_release();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user