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

Function impl_allocate

include/daScript/simulate/heap.h:307–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

305 public:
306 LinearHeapAllocator() {}
307 virtual char * impl_allocate ( uint64_t size ) override {
308 if ( limit==0 || model.bytesAllocated()+size<=limit ) {
309 totalAllocations ++;
310 totalBytesAllocated += size;
311 return model.allocate(size);
312 } else {
313 return nullptr;
314 }
315 }
316 virtual void impl_free ( char * ptr, uint64_t size ) override;
317 virtual char * impl_reallocate ( char * ptr, uint64_t oldSize, uint64_t newSize ) override;
318 virtual int depth() const override;

Callers 3

impl_allocateIteratorMethod · 0.85
allocateNameMethod · 0.85
impl_allocateStringMethod · 0.85

Calls 2

bytesAllocatedMethod · 0.45
allocateMethod · 0.45

Tested by

no test coverage detected