MCPcopy Create free account
hub / github.com/defold/defold / AddToCache

Function AddToCache

engine/modelc/src/modelimporter_gltf.cpp:225–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223
224template<typename DefoldType, typename CgltfType>
225static void AddToCache(dmHashTable64<void*>* cache, CgltfType* key, DefoldType* obj)
226{
227 if (cache->Full())
228 {
229 uint32_t cap = cache->Capacity() + 256;
230 cache->SetCapacity((cap*3/2), cap);
231 }
232 cache->Put((uintptr_t)key, (void*)obj);
233}
234
235template<typename DefoldType, typename CgltfType>
236static DefoldType* GetFromCache(dmHashTable64<void*>* cache, CgltfType* key)

Callers 3

LoadSamplersFunction · 0.70
LoadImagesFunction · 0.70
LoadTexturesFunction · 0.70

Calls 4

FullMethod · 0.45
CapacityMethod · 0.45
SetCapacityMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected