chromium/third_party/ipcz/src/ipcz/block_allocator.h

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

#ifndef IPCZ_SRC_IPCZ_BLOCK_ALLOCATOR_H_
#define IPCZ_SRC_IPCZ_BLOCK_ALLOCATOR_H_

#include <atomic>
#include <cstddef>
#include <cstdint>

#include "ipcz/ipcz.h"
#include "third_party/abseil-cpp/absl/base/macros.h"
#include "third_party/abseil-cpp/absl/types/span.h"

namespace ipcz {

// BlockAllocator manages a region of memory, dividing it into dynamically
// allocable blocks of a smaller fixed size. Allocation prioritizes reuse of the
// most recently freed blocks.
//
// This is a thread-safe, lock-free implementation which doesn't store heap
// pointers within the managed region. Multiple BlockAllocators may therefore
// cooperatively manage the same region of memory for the same block size across
// different threads and processes.
class BlockAllocator {};

}  // namespace ipcz

#endif  // IPCZ_SRC_IPCZ_BLOCK_ALLOCATOR_H_