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

Method free

include/daScript/misc/memory_model.h:102–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 return nullptr;
101 }
102 __forceinline void free ( char * ptr ) {
103 ptrdiff_t idx = (ptr - data) / size;
104 DAS_ASSERT ( idx>=0 && idx<ptrdiff_t(total) );
105 uint64_t uidx = uint64_t(idx);
106 uint64_t i = uidx >> 5;
107 uint32_t j = uint32_t(uidx & 31);
108 uint32_t b = bits[i];
109 DAS_ASSERT((b & (1u<<j))!=0 && "calling free on the pointer, which is already free");
110 bits[i] = b ^ (1u<<j);
111 look = i;
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) );

Callers 8

freeFunction · 0.45
heap.hFile · 0.45
reserveInternalMethod · 0.45
clearMethod · 0.45
clearMethod · 0.45
clearMethod · 0.45
clearMethod · 0.45
freeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected