#ifdef PARTITION_ALLOC_SHIM_SHIM_ALLOC_FUNCTIONS_H_
#error This header is meant to be included only once by allocator_shim*.cc
#endif
#ifndef PARTITION_ALLOC_SHIM_SHIM_ALLOC_FUNCTIONS_H_
#define PARTITION_ALLOC_SHIM_SHIM_ALLOC_FUNCTIONS_H_
#include <cerrno>
#include "partition_alloc/build_config.h"
#include "partition_alloc/buildflags.h"
#include "partition_alloc/partition_alloc_base/bits.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_base/memory/page_size.h"
#include "partition_alloc/partition_alloc_check.h"
namespace {
PA_ALWAYS_INLINE size_t GetCachedPageSize() { … }
}
extern "C" {
PA_ALWAYS_INLINE void* ShimCppNew(size_t size) { … }
PA_ALWAYS_INLINE void* ShimCppNewNoThrow(size_t size) { … }
PA_ALWAYS_INLINE void* ShimCppAlignedNew(size_t size, size_t alignment) { … }
PA_ALWAYS_INLINE void ShimCppDelete(void* address) { … }
PA_ALWAYS_INLINE void* ShimMalloc(size_t size, void* context) { … }
PA_ALWAYS_INLINE void* ShimCalloc(size_t n, size_t size, void* context) { … }
PA_ALWAYS_INLINE void* ShimRealloc(void* address, size_t size, void* context) { … }
PA_ALWAYS_INLINE void* ShimMemalign(size_t alignment,
size_t size,
void* context) { … }
PA_ALWAYS_INLINE int ShimPosixMemalign(void** res,
size_t alignment,
size_t size) { … }
PA_ALWAYS_INLINE void* ShimValloc(size_t size, void* context) { … }
PA_ALWAYS_INLINE void* ShimPvalloc(size_t size) { … }
PA_ALWAYS_INLINE void ShimFree(void* address, void* context) { … }
PA_ALWAYS_INLINE size_t ShimGetSizeEstimate(const void* address,
void* context) { … }
PA_ALWAYS_INLINE size_t ShimGoodSize(size_t size, void* context) { … }
PA_ALWAYS_INLINE bool ShimClaimedAddress(void* address, void* context) { … }
PA_ALWAYS_INLINE unsigned ShimBatchMalloc(size_t size,
void** results,
unsigned num_requested,
void* context) { … }
PA_ALWAYS_INLINE void ShimBatchFree(void** to_be_freed,
unsigned num_to_be_freed,
void* context) { … }
PA_ALWAYS_INLINE void ShimFreeDefiniteSize(void* ptr,
size_t size,
void* context) { … }
PA_ALWAYS_INLINE void ShimTryFreeDefault(void* ptr, void* context) { … }
PA_ALWAYS_INLINE void* ShimAlignedMalloc(size_t size,
size_t alignment,
void* context) { … }
PA_ALWAYS_INLINE void* ShimAlignedRealloc(void* address,
size_t size,
size_t alignment,
void* context) { … }
PA_ALWAYS_INLINE void ShimAlignedFree(void* address, void* context) { … }
#undef PA_ALWAYS_INLINE
}
#endif