diff options
Diffstat (limited to 'runtime/base/allocator.cc')
-rw-r--r-- | runtime/base/allocator.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/runtime/base/allocator.cc b/runtime/base/allocator.cc index 994e2357af..4f2fc074fb 100644 --- a/runtime/base/allocator.cc +++ b/runtime/base/allocator.cc @@ -30,11 +30,11 @@ class MallocAllocator FINAL : public Allocator { explicit MallocAllocator() {} ~MallocAllocator() {} - virtual void* Alloc(size_t size) { + void* Alloc(size_t size) { return calloc(sizeof(uint8_t), size); } - virtual void Free(void* p) { + void Free(void* p) { free(p); } @@ -49,13 +49,15 @@ class NoopAllocator FINAL : public Allocator { explicit NoopAllocator() {} ~NoopAllocator() {} - virtual void* Alloc(size_t size) { + void* Alloc(size_t size) { + UNUSED(size); LOG(FATAL) << "NoopAllocator::Alloc should not be called"; - return NULL; + UNREACHABLE(); } - virtual void Free(void* p) { + void Free(void* p) { // Noop. + UNUSED(p); } private: |