summaryrefslogtreecommitdiff
path: root/linker/linker_allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linker/linker_allocator.cpp')
-rw-r--r--linker/linker_allocator.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/linker/linker_allocator.cpp b/linker/linker_allocator.cpp
index c8b97b121..f5d3745b4 100644
--- a/linker/linker_allocator.cpp
+++ b/linker/linker_allocator.cpp
@@ -28,17 +28,12 @@ struct FreeBlockInfo {
size_t num_free_blocks;
};
-LinkerBlockAllocator::LinkerBlockAllocator()
- : block_size_(0),
+LinkerBlockAllocator::LinkerBlockAllocator(size_t block_size)
+ : block_size_(block_size < sizeof(FreeBlockInfo) ? sizeof(FreeBlockInfo) : block_size),
page_list_(nullptr),
free_block_list_(nullptr)
{}
-void LinkerBlockAllocator::init(size_t block_size) {
- block_size_ = block_size < sizeof(FreeBlockInfo) ? sizeof(FreeBlockInfo) : block_size;
-}
-
-
void* LinkerBlockAllocator::alloc() {
if (free_block_list_ == nullptr) {
create_new_page();