- allocate
T allocate(A args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocate
T* allocate(A args, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocate
T allocate(size_t length, string file, int line)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocate
T allocate(A args)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocate
T* allocate(A args)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocate
T allocate(size_t length)
Undocumented in source. Be warned that the author may not have intended to support it.
- allocatedMemory
ulong allocatedMemory()
Returns current amount of allocated memory in bytes. This is 0 at program start
- deallocate
void deallocate(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.
- deallocate
void deallocate(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.
- deallocate
void deallocate(T* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
- enableMemoryProfiler
void enableMemoryProfiler(bool mode)
Enables or disables memory profiler
- globalAllocator
Allocator globalAllocator()
Returns current global Allocator that is used by New and Delete
- globalAllocator
void globalAllocator(Allocator a)
Sets global Allocator that is used by New and Delete
- printMemoryLeaks
void printMemoryLeaks()
Prints leaked allocations if memory profiler is enabled, otherwise does nothing
- printMemoryLog
void printMemoryLog()
Prints full allocation list if memory profiler is enabled, otherwise does nothing
Tools for manual memory management
New/Delete for classes, structs and arrays. It utilizes dlib.memory for actual memory allocation, so it is possible to switch allocator that is being used. By default, dlib.memory.mallocator.Mallocator is used.
Module includes a simple memory profiler that can be turned on with enableMemoryProfiler function. If active, it will store information about every allocation (type and size), and will mark those which are leaked (haven't been deleted).