SpiecsEngine
 
Loading...
Searching...
No Matches

◆ GetNBlocksLimit()

size_t Spices::MemoryPool::GetNBlocksLimit ( size_t size)
static

Get count of blocks limit by tc align up bytes.

Parameters
[in]sizealign up bytes.
Returns
Returns blocks limit.

[2 - 512].

[2 - 512].

Definition at line 175 of file MemoryPool.cpp.

176 {
177 assert(size > 0);
178
182 size_t num = MAX_BYTES / size;
183 num = std::max(std::min(static_cast<size_t>(512), num), static_cast<size_t>(2));
184
185 return num;
186 }
static constexpr size_t MAX_BYTES
Only allowed 256KB allocated memory one time in tc.
Definition MemoryPool.h:34