aboutsummaryrefslogtreecommitdiffstats
path: root/linker/linker_allocator.cpp
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-07-24 15:33:25 -0700
committerDmitriy Ivanov <dimitry@google.com>2014-07-24 15:33:25 -0700
commit4151ea73b75e274d1ff80b42d9d457a783208516 (patch)
tree5095a8609376eccfc649da4af282d10da47abb06 /linker/linker_allocator.cpp
parent7d22a4519610f830178bbff32d961a2784354397 (diff)
downloadandroid_bionic-4151ea73b75e274d1ff80b42d9d457a783208516.tar.gz
android_bionic-4151ea73b75e274d1ff80b42d9d457a783208516.tar.bz2
android_bionic-4151ea73b75e274d1ff80b42d9d457a783208516.zip
Fix global variable initialization for linker
Linker now calls init functions for itself. Change-Id: Ibd099812493041ac70f591e3f379ee742b4683b8
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();