Tracking Allocator¶
-
class TrackingAllocator : public simul::base::MemoryInterface¶
A pseudo allocator that tracks video memory but does not actually allocate it.
Public Functions
-
virtual void *AllocateTracked(size_t nbytes, size_t align, const char *fn) override¶
Allocate nbytes bytes of memory, aligned to align and return a pointer to them.
-
virtual void Deallocate(void *ptr) override¶
De-allocate the memory at.
- Parameters:
address – (requires that this memory was allocated with Allocate()).
-
virtual void TrackVideoMemory(const void *ptr, size_t nbytes, const char *fn) override¶
Track (but don’t allocate) nbytes bytes of memory.
-
virtual void UntrackVideoMemory(const void *ptr) override¶
Free the pointer from video memory tracking.
-
void Shutdown()¶
Shut down and report any leaks.
-
virtual void *AllocateTracked(size_t nbytes, size_t align, const char *fn) override¶