mirror of
https://github.com/justinian/jsix.git
synced 2025-12-12 01:14:31 -08:00
[kernel] Remove explicit allocator passing
Many kernel objects had to keep a hold of refrences to allocators in order to pass them on down the call chain. Remove those explicit refrences and use `operator new`, `operator delete`, and define new `kalloc` and `kfree`. Also remove `slab_allocator` and replace it with a new mixin for slab allocation, `slab_allocated`, that overrides `operator new` and `operator free` for its subclass. Remove some no longer used related headers, `buddy_allocator.h` and `address_manager.h` Tags: memory
This commit is contained in:
@@ -49,7 +49,7 @@ class disk
|
||||
public:
|
||||
/// Constructor.
|
||||
/// \arg start The start of the initrd in memory
|
||||
disk(const void *start, kutil::allocator &alloc);
|
||||
disk(const void *start);
|
||||
|
||||
/// Get the vector of files on the disk
|
||||
const kutil::vector<file> & files() const { return m_files; }
|
||||
|
||||
@@ -23,8 +23,7 @@ file::executable() const {
|
||||
}
|
||||
|
||||
|
||||
disk::disk(const void *start, kutil::allocator &alloc) :
|
||||
m_files(alloc)
|
||||
disk::disk(const void *start)
|
||||
{
|
||||
auto *header = reinterpret_cast<const disk_header *>(start);
|
||||
size_t length = header->length;
|
||||
|
||||
Reference in New Issue
Block a user