blob: 2973908cba05a92f4722764e9cd106e6e2d99111 [file] [log] [blame]
//===- PoolAllocator.h - Pool allocator runtime interface file --*- C++ -*-===//
// The LLVM Compiler Infrastructure
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
// This file defines the interface which is implemented by the LLVM pool
// allocator runtime library.
typedef struct PoolTy {
// Ptr1, Ptr2 - Implementation specified data pointers.
void *Ptr1, *Ptr2;
// NodeSize - Keep track of the object size tracked by this pool
unsigned NodeSize;
// FreeablePool - Set to false if the memory from this pool cannot be freed
// before destroy.
unsigned FreeablePool;
} PoolTy;
extern "C" {
void poolinit(PoolTy *Pool, unsigned NodeSize);
void poolmakeunfreeable(PoolTy *Pool);
void pooldestroy(PoolTy *Pool);
void *poolalloc(PoolTy *Pool, unsigned NumBytes);
void poolfree(PoolTy *Pool, void *Node);
void poolcheck(PoolTy *Pool, void *Node);