Skip to content

Commit db84e82

Browse files
authored
Merge pull request #101 from davidbrochart/all_chunk_pool
Allow pool_size=-1
2 parents b72191a + 2a45533 commit db84e82

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/xtensor-io/xchunk_store_manager.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,15 @@ namespace xt
216216
const std::string& directory,
217217
std::size_t pool_size)
218218
: m_shape(shape)
219-
, m_chunk_pool(pool_size)
220-
, m_index_pool(pool_size)
221219
, m_unload_index(0u)
222220
{
221+
if (pool_size == -1)
222+
{
223+
// as many "physical" chunks in the pool as there are "logical" chunks
224+
pool_size = size();
225+
}
226+
m_chunk_pool.resize(pool_size);
227+
m_index_pool.resize(pool_size);
223228
// resize the pool chunks
224229
for (auto& chunk: m_chunk_pool)
225230
{

0 commit comments

Comments
 (0)