Module pool

Source
Expand description

This module contains traits for memory pool traits and an implementation for tracking memory usage.

The basic traits are MemoryPool and MemoryReservation. And default implementation of MemoryPool is TrackingMemoryPool. Their relationship is as follows:

    (pool tracker)                        (resizable)           
 ┌──────────────────┐ fn reserve() ┌─────────────────────────┐
 │ trait MemoryPool │─────────────►│ trait MemoryReservation │
 └──────────────────┘              └─────────────────────────┘

Structs§

Tracker 🔒
TrackingMemoryPool
A simple MemoryPool that reports the total memory usage

Traits§

MemoryPool
A pool of memory that can be reserved and released.
MemoryReservation
A memory reservation within a MemoryPool that is freed on drop