chromium/third_party/angle/src/common/PoolAlloc.cpp

//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// PoolAlloc.cpp:
//    Implements the class methods for PoolAllocator and Allocation classes.
//

#include "common/PoolAlloc.h"

#include <assert.h>
#include <stdint.h>
#include <stdio.h>

#include "common/angleutils.h"
#include "common/debug.h"
#include "common/mathutil.h"
#include "common/platform.h"
#include "common/tls.h"

#if defined(ANGLE_WITH_ASAN)
#    include <sanitizer/asan_interface.h>
#endif

namespace angle
{
// If we are using guard blocks, we must track each individual allocation.  If we aren't using guard
// blocks, these never get instantiated, so won't have any impact.

class Allocation
{};

#if !defined(ANGLE_DISABLE_POOL_ALLOC)
class PageHeader
{};
#endif

//
// Implement the functionality of the PoolAllocator class, which
// is documented in PoolAlloc.h.
//
PoolAllocator::PoolAllocator(int growthIncrement, int allocationAlignment)
    :{}

void PoolAllocator::initialize(int pageSize, int alignment)
{}

PoolAllocator::~PoolAllocator()
{}

//
// Check a single guard block for damage
//
void Allocation::checkGuardBlock(unsigned char *blockMem,
                                 unsigned char val,
                                 const char *locText) const
{}

void PoolAllocator::push()
{}

// Do a mass-deallocation of all the individual allocations that have occurred since the last
// push(), or since the last pop(), or since the object's creation.
//
// Single-page allocations are saved for future use unless the release strategy is All.
void PoolAllocator::pop(ReleaseStrategy releaseStrategy)
{}

//
// Do a mass-deallocation of all the individual allocations
// that have occurred.
//
void PoolAllocator::popAll()
{}

void *PoolAllocator::allocate(size_t numBytes)
{}

#if !defined(ANGLE_DISABLE_POOL_ALLOC)
uint8_t *PoolAllocator::allocateNewPage(size_t numBytes)
{}

void *PoolAllocator::initializeAllocation(uint8_t *memory, size_t numBytes)
{}
#endif

void PoolAllocator::lock()
{}

void PoolAllocator::unlock()
{}

//
// Check all allocations in a list for damage by calling check on each.
//
void Allocation::checkAllocList() const
{}

}  // namespace angle