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

Function AddToCache

engine/modelc/src/modelimporter_jni.cpp:33–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32template<typename DefoldType>
33static void AddToCache(dmHashTable64<jobject>& cache, DefoldType* key, jobject obj)
34{
35 if (cache.Full())
36 {
37 uint32_t cap = cache.Capacity() + 256;
38 cache.SetCapacity((cap*3/2), cap);
39 }
40 cache.Put((uintptr_t)key, obj);
41}
42
43template<typename DefoldType>
44static jobject GetFromCache(dmHashTable64<jobject>& cache, DefoldType* key)

Callers 4

CreateImagesArrayFunction · 0.70
CreateSamplersArrayFunction · 0.70
CreateTexturesArrayFunction · 0.70
CreateBufferArrayFunction · 0.70

Calls 4

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

Tested by

no test coverage detected