|
static size_t | AlignByteSize (size_t byte_size, size_t alignment=8) |
|
◆ MemoryCache() [1/2]
open3d::core::MemoryCache::MemoryCache |
( |
| ) |
|
|
default |
◆ MemoryCache() [2/2]
open3d::core::MemoryCache::MemoryCache |
( |
const MemoryCache & |
| ) |
|
|
delete |
◆ Acquire()
void open3d::core::MemoryCache::Acquire |
( |
void * |
ptr, |
|
|
size_t |
byte_size, |
|
|
const std::shared_ptr< MemoryManagerDevice > & |
device_mm |
|
) |
| |
|
inline |
Acquires ownership of the new real allocated blocks.
◆ AlignByteSize()
static size_t open3d::core::MemoryCache::AlignByteSize |
( |
size_t |
byte_size, |
|
|
size_t |
alignment = 8 |
|
) |
| |
|
inlinestatic |
Computes an internal byte size that ensures a proper alignment of the real and virtual blocks.
◆ Empty()
bool open3d::core::MemoryCache::Empty |
( |
| ) |
const |
|
inline |
True if the set of allocated real blocks is empty, false otherwise.
◆ Free()
void open3d::core::MemoryCache::Free |
( |
void * |
ptr | ) |
|
|
inline |
Frees memory by moving the corresponding block to the set of free virtual blocks. Consecutive free virtual blocks belonging to the same real block are merged together.
◆ Malloc()
void* open3d::core::MemoryCache::Malloc |
( |
size_t |
byte_size | ) |
|
|
inline |
Allocates memory from the set of free virtual blocks. Returns nullptr if no suitable block was found.
◆ operator=()
◆ Release()
std::vector<std::pair<void*, std::shared_ptr<MemoryManagerDevice> > > open3d::core::MemoryCache::Release |
( |
size_t |
byte_size | ) |
|
|
inline |
Releases ownership of unused real allocated blocks whose sizes sum up to the requested byte size. Strategy:
- Best single fit: argmin_x { x.byte_size_ >= byte_size }.
- If not found, use next-best fit and repeat.
◆ ReleaseAll()
std::vector<std::pair<void*, std::shared_ptr<MemoryManagerDevice> > > open3d::core::MemoryCache::ReleaseAll |
( |
| ) |
|
|
inline |
Releases ownership of all unused real allocated blocks.
◆ Size()
size_t open3d::core::MemoryCache::Size |
( |
| ) |
const |
|
inline |
Returns the number of allocated real blocks.
The documentation for this class was generated from the following file: