pytorch/executorch ciflow/trunk/20307 (opens in new tab)
#Python Add MemoryAllocator used_size()/free_size() accessors (#20307) Summary: Problem executorch::runtime::MemoryAllocator is a bump allocator, but it does not expose how much of its buffer is currently consumed: the bump cursor (cur_) is private. Consumers that need the allocation high-water have to re-derive it from the returned block pointer and the base address. Duplication this removes This exact "used offset" math is already re-implemented by multiple MemoryAllocator subclasses: [[ | ...
Read the original article