MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / mark

Method mark

include/daScript/misc/memory_model.h:114–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 allocated --;
113 }
114 __forceinline bool mark ( char * ptr ) {
115 ptrdiff_t idx = (ptr - data) / size;
116 DAS_ASSERT ( idx>=0 && idx<ptrdiff_t(total) );
117 uint64_t uidx = uint64_t(idx);
118 uint64_t i = uidx >> 5;
119 uint32_t j = uint32_t(uidx & 31);
120 uint32_t b = gc_bits[i];
121 if ( !(b & (1u<<j)) ) {
122 gc_bits[i] = b | (1u<<j);
123 gc_allocated ++;
124 return true;
125 }
126 return false;
127 }
128 char * data = nullptr;
129 uint32_t * bits = nullptr; // 32-bit bitset words; indices are 64-bit
130 uint32_t * gc_bits = nullptr;

Callers 1

markMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected