Path: blob/main/contrib/llvm-project/llvm/lib/Support/Allocator.cpp
35234 views
//===--- Allocator.cpp - Simple memory allocation abstraction -------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file implements the BumpPtrAllocator interface.9//10//===----------------------------------------------------------------------===//1112#include "llvm/Support/Allocator.h"13#include "llvm/Support/raw_ostream.h"1415namespace llvm {1617namespace detail {1819void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,20size_t TotalMemory) {21errs() << "\nNumber of memory regions: " << NumSlabs << '\n'22<< "Bytes used: " << BytesAllocated << '\n'23<< "Bytes allocated: " << TotalMemory << '\n'24<< "Bytes wasted: " << (TotalMemory - BytesAllocated)25<< " (includes alignment, etc)\n";26}2728} // namespace detail2930void PrintRecyclerStats(size_t Size,31size_t Align,32size_t FreeListSize) {33errs() << "Recycler element size: " << Size << '\n'34<< "Recycler element alignment: " << Align << '\n'35<< "Number of elements free for recycling: " << FreeListSize << '\n';36}3738} // namespace llvm394041