You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples_tests/10.AllocatorTest/main.cpp
+13-41Lines changed: 13 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -7,38 +7,23 @@ using namespace irr;
7
7
usingnamespacecore;
8
8
9
9
#defineALLOCATOR_TEST
10
-
//#define ALLOCATOR_TEST_OLD
11
10
//#define ADDRESS_ALLOCATOR_TRAITS_TEST
12
11
//#define ALLOC_PREF_TEST
13
12
14
13
#ifdef ALLOCATOR_TEST
15
14
16
-
structAllocationCreationParameters
17
-
{
18
-
size_t multiAllocCnt; //! Specifies amount of adress to be allocated with certain choosen allocator
19
-
size_t adressesToDeallocateCnt; //! Specifies amount of adress to be deallocated with certain choosen allocator. Must be less than all allocated and must pick number less than `traits::max_multi_free`, but we don't have `max_multi_free`
for (size_t i = 0; i < creationParameters.multiAllocCnt; ++i)
49
+
constuint32_t testsCnt = rng.getRndAllocCnt();
50
+
for (size_t i = 0; i < testsCnt; ++i)
75
51
executeForFrame();
76
52
}
77
53
@@ -194,7 +170,8 @@ class AllocatorHandler
194
170
for (uint32_t i = 0u; i < multiFreeCnt; i++)
195
171
{
196
172
// randomly how many addresses we should deallocate (but obvs less than all allocated) NOTE: must pick number less than `traits::max_multi_free`
197
-
constuint32_t addressesToFreeCnt = rng.getRandomNumber(0u, results.size()); //that should be restrained somehow, I think... so it it less likely to free all of allocated addresses
0 commit comments