Skip to content

Commit 3a8e7c6

Browse files
committed
Fix
1 parent 6aad58f commit 3a8e7c6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples_tests/10.AllocatorTest/main.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,23 +168,20 @@ class AllocatorHandler
168168
if(results.size() == 0u)
169169
return;
170170

171-
outAddresses.clear();
172-
sizes.clear();
173-
alignments.clear();
174-
175171
// randomly decide how many calls to `multi_free`
176172
const uint32_t multiFreeCnt = rng.getRandomNumber(1u, results.size());
177173

178-
//TODO:
179-
//shuffle results
180-
181174
if (std::is_same<AlctrType, core::GeneralpurposeAddressAllocator<uint32_t>>::value)
182175
{
183176
std::shuffle(results.begin(), results.end(), rng.getMt());
184177
}
185178

186179
for (uint32_t i = 0u; (i < multiFreeCnt) && results.size(); i++)
187180
{
181+
outAddresses.clear();
182+
sizes.clear();
183+
alignments.clear();
184+
188185
// randomly how many addresses we should deallocate (but obvs less than all allocated) NOTE: must pick number less than `traits::max_multi_free`
189186
const uint32_t addressesToFreeUpperBound = min(Traits::maxMultiOps, results.size());
190187
const uint32_t addressesToFreeCnt = rng.getRandomNumber(0u, addressesToFreeUpperBound);

0 commit comments

Comments
 (0)