Fix global variable initialization for linker
Linker now calls init functions for itself.
(cherry picked from commit 4151ea73b7
)
Change-Id: I3300fe22de8ad8466a5b1c2d551429769a42852d
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user