chromium/base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_functions.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 =;

// Calls the std::new handler thread-safely. Returns true if a new_handler was
// set and called, false if no new_handler was set.
bool CallNewHandler(size_t size) {}

#if !(PA_BUILDFLAG(IS_WIN) && defined(COMPONENT_BUILD))
PA_ALWAYS_INLINE
#endif
const allocator_shim::AllocatorDispatch* GetChainHead() {}

}  // namespace internal

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() {}

}  // namespace allocator_shim

#endif  // PARTITION_ALLOC_SHIM_ALLOCATOR_SHIM_FUNCTIONS_H_