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

Method allocate

include/daScript/misc/memory_model.h:164–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163 }
164 char * allocate ( uint32_t size ) {
165 size = (size + 15) & ~15;
166 DAS_ASSERT(size && size<=DAS_MAX_SHOE_ALLOCATION);
167 uint32_t si = (size >> 4) - 1;
168 for ( auto ch = chunks[si]; ch; ch=ch->next ) {
169 if ( char * res = ch->allocate() ) {
170 return res;
171 }
172 }
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);

Callers

nothing calls this directly

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected