|
| static size_t | AlignByteSize (size_t byte_size, size_t alignment=8) |
| |
Definition at line 78 of file MemoryManagerCached.cpp.
◆ MemoryCache() [1/2]
| cloudViewer::core::MemoryCache::MemoryCache |
( |
| ) |
|
|
default |
◆ MemoryCache() [2/2]
| cloudViewer::core::MemoryCache::MemoryCache |
( |
const MemoryCache & |
| ) |
|
|
delete |
◆ Acquire()
| void cloudViewer::core::MemoryCache::Acquire |
( |
void * |
ptr, |
|
|
size_t |
byte_size, |
|
|
const std::shared_ptr< MemoryManagerDevice > & |
device_mm |
|
) |
| |
|
inline |
◆ AlignByteSize()
| static size_t cloudViewer::core::MemoryCache::AlignByteSize |
( |
size_t |
byte_size, |
|
|
size_t |
alignment = 8 |
|
) |
| |
|
inlinestatic |
◆ Empty()
| bool cloudViewer::core::MemoryCache::Empty |
( |
| ) |
const |
|
inline |
◆ Free()
| void cloudViewer::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.
Definition at line 132 of file MemoryManagerCached.cpp.
References LogError.
◆ Malloc()
| void* cloudViewer::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.
Definition at line 92 of file MemoryManagerCached.cpp.
◆ operator=()
◆ Release()
| std::vector<std::pair<void*, std::shared_ptr<MemoryManagerDevice> > > cloudViewer::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.
Definition at line 230 of file MemoryManagerCached.cpp.
Referenced by ReleaseAll().
◆ ReleaseAll()
| std::vector<std::pair<void*, std::shared_ptr<MemoryManagerDevice> > > cloudViewer::core::MemoryCache::ReleaseAll |
( |
| ) |
|
|
inline |
◆ Size()
| size_t cloudViewer::core::MemoryCache::Size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: