mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- central way to calculate reverse sizes for dynamic containers.
For example;
reserve_size<16, 2>(len, cap); // min-size=16, ratio=2
reserve_size<16, 3, 2>(len, cap); // min-size=16, ratio=1.5
replaces this type of code that was used in several places:
max(SizeMin, max(len, label(2*capacity_)));
The caller will have already checked (len < cap) before deciding
to make this call.
ENH: updates for DynamicList/DynamicField handling
- add reserve_exact() method, which is like reserve() but without any
extra sizing heuristics
- add DynamicField 'reuse' constructors, consistent with Field constructors
- sync allocated size before list destruction.
This may help when using aligned allocation strategies.