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

Method free

include/daScript/misc/memory_model.h:175–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173 return nullptr;
174 }
175 void free ( char * ptr, uint32_t size ) {
176 size = (size + 15) & ~15;
177 DAS_ASSERT(size && size<=DAS_MAX_SHOE_ALLOCATION);
178 uint32_t si = (size >> 4) - 1;
179 for ( auto ch = chunks[si]; ch; ch=ch->next ) {
180 if ( ch->isOwnPtr(ptr) ) {
181 ch->free(ptr);
182 return;
183 }
184 }
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);

Callers

nothing calls this directly

Calls 2

isOwnPtrMethod · 0.45
freeMethod · 0.45

Tested by

no test coverage detected