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

Method isAllocatedPtr

include/daScript/misc/memory_model.h:73–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 return (ptr>=data) && (ptr<data+totalBytes);
72 }
73 __forceinline bool isAllocatedPtr ( char * ptr ) {
74 ptrdiff_t idx = (ptr - data) / size;
75 DAS_ASSERT ( idx>=0 && idx<ptrdiff_t(total) );
76 uint64_t uidx = uint64_t(idx);
77 uint64_t i = uidx >> 5;
78 uint32_t j = uint32_t(uidx & 31);
79 uint32_t b = bits[i];
80 return ((b & (1u<<j))!=0);
81 }
82 __forceinline char * allocate ( ) {
83 if ( allocated == total ) return nullptr;
84 uint64_t maxt = total / 32;

Callers 4

isValidPtrMethod · 0.45
sweepFunction · 0.45
isAllocatedPtrMethod · 0.45
isAllocatedPtrFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected