LLVM  15.0.0git

BasicLayout simplifies the implementation of JITLinkMemoryManagers. More...

#include "llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h"

## Classes

struct  ContiguousPageBasedLayoutSizes
A convenience class that further groups segments based on memory deallocation policy. More...

class  Segment
The Alignment, ContentSize and ZeroFillSize of each segment will be pre-filled from the Graph. More...

## Public Member Functions

Return a reference to the graph this allocation was created from. More...

Expected< ContiguousPageBasedLayoutSizesgetContiguousPageBasedLayoutSizes (uint64_t PageSize)
Returns the total number of required to allocate all segments (with each segment padded out to page size) for all standard segments, and all finalize segments. More...

iterator_range< SegmentMap::iteratorsegments ()
Returns an iterator over the segments of the layout. More...

Error apply ()
Apply the layout to the graph. More...

orc::shared::AllocActionsgraphAllocActions ()
Returns a reference to the AllocActions in the graph. More...

## Detailed Description

BasicLayout simplifies the implementation of JITLinkMemoryManagers.

BasicLayout groups Sections into Segments based on their memory protection and deallocation policies. JITLinkMemoryManagers can construct a BasicLayout from a Graph, and then assign working memory and addresses to each of the Segments. These addreses will be mapped back onto the Graph blocks in the apply method.

Definition at line 210 of file JITLinkMemoryManager.h.

## ◆ BasicLayout()

Definition at line 24 of file JITLinkMemoryManager.cpp.

## ◆ apply()

Apply the layout to the graph.

Definition at line 101 of file JITLinkMemoryManager.cpp.

References llvm::jitlink::alignToBlock(), assert(), B, memcpy(), and llvm::Error::success().

## ◆ getContiguousPageBasedLayoutSizes()

 Expected< BasicLayout::ContiguousPageBasedLayoutSizes > llvm::jitlink::BasicLayout::getContiguousPageBasedLayoutSizes ( uint64_t PageSize )

Returns the total number of required to allocate all segments (with each segment padded out to page size) for all standard segments, and all finalize segments.

This is a convenience function for the common case where the segments will be allocated contiguously.

This function will return an error if any segment has an alignment that is higher than a page.

Definition at line 80 of file JITLinkMemoryManager.cpp.

## ◆ getGraph()

inline

Return a reference to the graph this allocation was created from.

Definition at line 255 of file JITLinkMemoryManager.h.

## ◆ graphAllocActions()

Returns a reference to the AllocActions in the graph.

This convenience function saves callers from having to include LinkGraph.h if all they need are allocation actions.

Definition at line 141 of file JITLinkMemoryManager.cpp.