Merge "Use trivial types to avoid calls to new for globals"

This commit is contained in:
Dimitry Ivanov 2016-07-13 18:45:00 +00:00 committed by Gerrit Code Review
commit cc55bd8313
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@
*/ */
#include "linker_allocator.h" #include "linker_allocator.h"
#include "linker_debug.h"
#include "linker.h" #include "linker.h"
#include <algorithm> #include <algorithm>
@ -73,6 +74,8 @@ LinkerSmallObjectAllocator::LinkerSmallObjectAllocator()
: type_(0), block_size_(0), free_pages_cnt_(0), free_blocks_list_(nullptr) {} : type_(0), block_size_(0), free_pages_cnt_(0), free_blocks_list_(nullptr) {}
void* LinkerSmallObjectAllocator::alloc() { void* LinkerSmallObjectAllocator::alloc() {
CHECK(block_size_ != 0);
if (free_blocks_list_ == nullptr) { if (free_blocks_list_ == nullptr) {
alloc_page(); alloc_page();
} }

View File

@ -41,7 +41,7 @@
LinkerLogger g_linker_logger; LinkerLogger g_linker_logger;
static const char* kSystemLdDebugProperty = "debug.ld.all"; static const char* kSystemLdDebugProperty = "debug.ld.all";
static const std::string kLdDebugPropertyPrefix = "debug.ld.app."; static const char* kLdDebugPropertyPrefix = "debug.ld.app.";
static const char* kOptionErrors = "dlerror"; static const char* kOptionErrors = "dlerror";
static const char* kOptionDlopen = "dlopen"; static const char* kOptionDlopen = "dlopen";