Document deleter

This commit is contained in:
Eric Severance 2024-12-17 00:25:20 -08:00
parent 72d0731fae
commit abffaf6ff7
No known key found for this signature in database
GPG Key ID: 340D1DA2A5A64A62

View File

@ -56,7 +56,7 @@ template <class T> class Allocator
/// std::unique_ptr wrapped variant of allocZeroed(TickType_t maxWait). /// std::unique_ptr wrapped variant of allocZeroed(TickType_t maxWait).
UniqueAllocation allocUniqueZeroed(TickType_t maxWait) { return UniqueAllocation(allocZeroed(maxWait), deleter); } UniqueAllocation allocUniqueZeroed(TickType_t maxWait) { return UniqueAllocation(allocZeroed(maxWait), deleter); }
/// Return a queable object which is a copy of some other object /// Return a queable object which is a copy of some other object
// std::unique_ptr wrapped variant of allocCopy(const T &src, TickType_t maxWait). /// std::unique_ptr wrapped variant of allocCopy(const T &src, TickType_t maxWait).
UniqueAllocation allocUniqueCopy(const T &src, TickType_t maxWait = portMAX_DELAY) UniqueAllocation allocUniqueCopy(const T &src, TickType_t maxWait = portMAX_DELAY)
{ {
return UniqueAllocation(allocCopy(src, maxWait), deleter); return UniqueAllocation(allocCopy(src, maxWait), deleter);
@ -70,6 +70,7 @@ template <class T> class Allocator
virtual T *alloc(TickType_t maxWait) = 0; virtual T *alloc(TickType_t maxWait) = 0;
private: private:
// std::unique_ptr Deleter function; calls release().
const std::function<void(T *)> deleter; const std::function<void(T *)> deleter;
}; };