Define a modifier class like below and supply it to TAllocRecordingLog to complete the template. Create an instance of the completed TAllocRecordingLog before any allocation of interest is done. Inject RecordAlloc and RecordFree to your allocator wherever appropriate.