diff options
Diffstat (limited to 'libs/utils/Pool.cpp')
-rw-r--r-- | libs/utils/Pool.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/libs/utils/Pool.cpp b/libs/utils/Pool.cpp deleted file mode 100644 index 8f18cb9..0000000 --- a/libs/utils/Pool.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// -// Copyright 2010 The Android Open Source Project -// -// A simple memory pool. -// -#define LOG_TAG "Pool" - -//#define LOG_NDEBUG 0 - -#include <cutils/log.h> -#include <utils/Pool.h> - -#include <stdlib.h> - -namespace android { - -// TODO Provide a real implementation of a pool. This is just a stub for initial development. - -PoolImpl::PoolImpl(size_t objSize) : - mObjSize(objSize) { -} - -PoolImpl::~PoolImpl() { -} - -void* PoolImpl::allocImpl() { - void* ptr = malloc(mObjSize); - LOG_ALWAYS_FATAL_IF(ptr == NULL, "Cannot allocate new pool object."); - return ptr; -} - -void PoolImpl::freeImpl(void* obj) { - LOG_ALWAYS_FATAL_IF(obj == NULL, "Caller attempted to free NULL pool object."); - return free(obj); -} - -} // namespace android |