#ifdef PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_FUNCTIONS_H_
#error This header is meant to be included only once by allocator_shim*.cc except allocator_shim_win_component.cc
#endif
#ifndef PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_FUNCTIONS_H_
#define PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_FUNCTIONS_H_
#include <atomic>
#include <cstddef>
#include <new>
#include "partition_alloc/build_config.h"
#include "partition_alloc/partition_alloc_base/compiler_specific.h"
#include "partition_alloc/partition_alloc_check.h"
#include "partition_alloc/shim/allocator_dispatch.h"
#include "partition_alloc/shim/allocator_shim.h"
#include "partition_alloc/shim/allocator_shim_internals.h"
#if PA_BUILDFLAG(IS_WIN)
#include "partition_alloc/shim/winheap_stubs_win.h"
#endif
namespace allocator_shim {
namespace internal {
std::atomic<const allocator_shim::AllocatorDispatch*> g_chain_head{ … };
bool g_call_new_handler_on_malloc_failure = …;
bool CallNewHandler(size_t size) { … }
#if !(PA_BUILDFLAG(IS_WIN) && defined(COMPONENT_BUILD))
PA_ALWAYS_INLINE
#endif
const allocator_shim::AllocatorDispatch* GetChainHead() { … }
}
void SetCallNewHandlerOnMallocFailure(bool value) { … }
void* UncheckedAlloc(size_t size) { … }
void* UncheckedRealloc(void* ptr, size_t size) { … }
void UncheckedFree(void* ptr) { … }
void* UncheckedAlignedAlloc(size_t size, size_t align) { … }
void* UncheckedAlignedRealloc(void* ptr, size_t size, size_t align) { … }
void UncheckedAlignedFree(void* ptr) { … }
void InsertAllocatorDispatch(AllocatorDispatch* dispatch) { … }
void RemoveAllocatorDispatchForTesting(AllocatorDispatch* dispatch) { … }
const AllocatorDispatch* GetAllocatorDispatchChainHeadForTesting() { … }
AutoResetAllocatorDispatchChainForTesting::
AutoResetAllocatorDispatchChainForTesting() { … }
AutoResetAllocatorDispatchChainForTesting::
~AutoResetAllocatorDispatchChainForTesting() { … }
}
#endif