clang 24.0.0git
clang::interp::FrameAllocator Class Referencefinal

Allocator for function frames. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/AST/ByteCode/FrameAllocator.h"

Public Member Functions

 FrameAllocator ()=default
 FrameAllocator (FrameAllocator &)=delete
 FrameAllocator (FrameAllocator &&)=delete
 ~FrameAllocator ()
char * reserve (unsigned Size)
void pop (unsigned FrameSize)
 Pop the memory of the last function frame that was added.

Detailed Description

Allocator for function frames.

The function frame size includes the size reserved for local variables. Function frames are allocated strictly in a LIFO manner, i.e. the last created frame is the first frame that is destroyed.

Since the address a function frame is allocated in needs to stay stable during the lifetime of the frame, we allocate them here in chunks.

A chunk is of (at least) MinChunkSize size and only gets deallocated once it is empty AND the previous chunk is also empty.

Definition at line 39 of file FrameAllocator.h.

Constructor & Destructor Documentation

◆ FrameAllocator() [1/3]

clang::interp::FrameAllocator::FrameAllocator ( )
default

Referenced by FrameAllocator(), and FrameAllocator().

◆ FrameAllocator() [2/3]

clang::interp::FrameAllocator::FrameAllocator ( FrameAllocator & )
delete

References FrameAllocator().

◆ FrameAllocator() [3/3]

clang::interp::FrameAllocator::FrameAllocator ( FrameAllocator && )
delete

References FrameAllocator().

◆ ~FrameAllocator()

clang::interp::FrameAllocator::~FrameAllocator ( )
inline

Definition at line 68 of file FrameAllocator.h.

Member Function Documentation

◆ pop()

void clang::interp::FrameAllocator::pop ( unsigned FrameSize)
inline

Pop the memory of the last function frame that was added.

The passed FrameSize needs to match the latest size passed to reserve(). If it doesn't, bad things will happen.

Definition at line 106 of file FrameAllocator.h.

References clang::C, and Used.

◆ reserve()

char * clang::interp::FrameAllocator::reserve ( unsigned Size)
inline

Definition at line 73 of file FrameAllocator.h.

References clang::C.


The documentation for this class was generated from the following file: