MCPcopy Create free account
hub / github.com/ReadyTalk/avian / internByteArray

Function internByteArray

src/machine.cpp:859–874  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859GcByteArray* internByteArray(Thread* t, GcByteArray* array)
860{
861 PROTECT(t, array);
862
863 ACQUIRE(t, t->m->referenceLock);
864
865 GcTriple* n = hashMapFindNode(
866 t, roots(t)->byteArrayMap(), array, byteArrayHash, byteArrayEqual);
867 if (n) {
868 return cast<GcByteArray>(t, cast<GcJreference>(t, n->first())->target());
869 } else {
870 hashMapInsert(t, roots(t)->byteArrayMap(), array, 0, byteArrayHash);
871 addFinalizer(t, array, removeByteArray);
872 return array;
873 }
874}
875
876unsigned parsePoolEntry(Thread* t,
877 Stream& s,

Callers 2

parsePoolEntryFunction · 0.85
resolveSystemClassFunction · 0.85

Calls 5

hashMapFindNodeFunction · 0.85
rootsFunction · 0.85
hashMapInsertFunction · 0.85
addFinalizerFunction · 0.85
firstMethod · 0.65

Tested by

no test coverage detected