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

Method mark

include/daScript/misc/memory_model.h:187–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185 DAS_FATAL_ERROR("deleting %p %i, which is not a chunk pointer (or chunk size mismatch)\n", (void *)ptr, size);
186 }
187 bool mark ( char * ptr, uint32_t size ) {
188 size = (size + 15) & ~15;
189 DAS_ASSERT(size && size<=DAS_MAX_SHOE_ALLOCATION);
190 if ( lastChunk && lastChunk->isOwnPtr(ptr) ) {
191 return lastChunk->mark(ptr);
192 }
193 uint32_t si = (size >> 4) - 1;
194 for ( auto ch = chunks[si]; ch; ch=ch->next ) {
195 if ( ch != lastChunk && ch->isOwnPtr(ptr) ) {
196 lastChunk = ch;
197 return ch->mark(ptr);
198 }
199 }
200 return false;
201 }
202 void beforeGC() {
203 for ( int i=0; i!=DAS_MAX_SHOE_CUNKS; ++i ) {
204 if ( chunks[i] ) chunks[i]->beforeGC();

Callers

nothing calls this directly

Calls 2

isOwnPtrMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected