marl icon indicating copy to clipboard operation
marl copied to clipboard

Ensure that all heap allocations use the marl::Allocator

Open ben-clayton opened this issue 5 years ago • 2 comments

marl::Allocator is the user-implementable interface that should be used for all marl heap allocations.

At the time of writing there are many places where we use std containers with the default allocator, which is clearly bypassing the marl::Allocator.

We should ensure that all allocations go through the provided marl::Allocator.

ben-clayton avatar May 20 '20 12:05 ben-clayton

RE shared_ptr; this may be useful: https://github.com/google/iree/blob/main/iree/base/ref_ptr.h (thread-safe intrusive pointer with support for type-specific custom deleters to make pooling easier)

benvanik avatar Jul 10 '20 19:07 benvanik

This pull request also replaces std::function with std::packaged_task. std::packaged_task can take an allocator which will help with some of this as well. https://github.com/google/marl/pull/216

AWoloszyn avatar Dec 17 '22 02:12 AWoloszyn