MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / Clay__InitializePersistentMemory

Function Clay__InitializePersistentMemory

include/clay.h:2245–2263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2243}
2244
2245void Clay__InitializePersistentMemory(Clay_Context* context) {
2246 // Persistent memory - initialized once and not reset
2247 int32_t maxElementCount = context->maxElementCount;
2248 int32_t maxMeasureTextCacheWordCount = context->maxMeasureTextCacheWordCount;
2249 Clay_Arena *arena = &context->internalArena;
2250
2251 context->scrollContainerDatas = Clay__ScrollContainerDataInternalArray_Allocate_Arena(100, arena);
2252 context->transitionDatas = Clay__TransitionDataInternalArray_Allocate_Arena(200, arena);
2253 context->layoutElementsHashMapInternal = Clay__LayoutElementHashMapItemArray_Allocate_Arena(maxElementCount, arena);
2254 context->layoutElementsHashMap = Clay__int32_tArray_Allocate_Arena(maxElementCount, arena);
2255 context->layoutElementsHashMapFreeList = Clay__int32_tArray_Allocate_Arena(maxElementCount, arena);
2256 context->measureTextHashMapInternal = Clay__MeasureTextCacheItemArray_Allocate_Arena(maxElementCount, arena);
2257 context->measureTextHashMapInternalFreeList = Clay__int32_tArray_Allocate_Arena(maxElementCount, arena);
2258 context->measuredWordsFreeList = Clay__int32_tArray_Allocate_Arena(maxMeasureTextCacheWordCount, arena);
2259 context->measureTextHashMap = Clay__int32_tArray_Allocate_Arena(maxElementCount, arena);
2260 context->measuredWords = Clay__MeasuredWordArray_Allocate_Arena(maxMeasureTextCacheWordCount, arena);
2261 context->pointerOverIds = Clay_ElementIdArray_Allocate_Arena(maxElementCount, arena);
2262 context->arenaResetOffset = arena->nextAllocation;
2263}
2264
2265const float CLAY__EPSILON = 0.01;
2266

Callers 2

Clay_MinMemorySizeFunction · 0.85
Clay_InitializeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected