Skip to content

Commit 18b8980

Browse files
committed
Deleted old example code
1 parent be56087 commit 18b8980

File tree

1 file changed

+2
-51
lines changed

1 file changed

+2
-51
lines changed

examples_tests/10.AllocatorTest/main.cpp

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class AllocatorHandler
106106
else
107107
{
108108
const auto reservedSize = AlctrType::reserved_size(randAllocParams.maxAlign, randAllocParams.addressSpaceSize, randAllocParams.blockSz);
109-
reservedSpace = _IRR_ALIGNED_MALLOC(reservedSize, _IRR_SIMD_ALIGNMENT);
109+
reservedSpace = _NBL_ALIGNED_MALLOC(reservedSize, _NBL_SIMD_ALIGNMENT);
110110
alctr = AlctrType(reservedSpace, randAllocParams.offset, randAllocParams.alignOffset, randAllocParams.maxAlign, randAllocParams.addressSpaceSize, randAllocParams.blockSz);
111111
}
112112

@@ -171,7 +171,7 @@ class AllocatorHandler
171171
}
172172

173173
if constexpr (!std::is_same<AlctrType, core::LinearAddressAllocator<uint32_t>>::value)
174-
_IRR_ALIGNED_FREE(reservedSpace);
174+
_NBL_ALIGNED_FREE(reservedSpace);
175175

176176
}
177177

@@ -278,55 +278,6 @@ int main()
278278

279279
#endif
280280

281-
#ifdef ALLOCATOR_TEST_OLD
282-
283-
/*
284-
Problems with GeneralPurposeallocator:
285-
1. GeneralPurposeallocator is not able to allocate as much address space as it is expected to
286-
2. Program doesn't compile, when I try to call safe_shrink_size
287-
3. "Assertion failed: false, file *\include\irr\core\alloc\GeneralpurposeAddressAllocator.h, line 368"
288-
*/
289-
290-
int main()
291-
{
292-
//1
293-
{
294-
void* resSpc = _IRR_ALIGNED_MALLOC(core::GeneralpurposeAddressAllocator<uint32_t>::reserved_size(alignof(uint32_t), 16u, 1u), _IRR_SIMD_ALIGNMENT);
295-
assert(resSpc != nullptr);
296-
auto alctr = core::GeneralpurposeAddressAllocator<uint32_t>(resSpc, 0u, 0u, alignof(uint32_t), 16u, 1u);
297-
298-
for (int i = 0; i < 16u; i++)
299-
{
300-
auto addr = alctr.alloc_addr(1u, 1u);
301-
if (addr == alctr.invalid_address)
302-
os::Printer::print("invalid adress");
303-
else
304-
os::Printer::print(std::to_string(addr));
305-
}
306-
_IRR_ALIGNED_FREE(resSpc);
307-
}
308-
309-
//2
310-
{
311-
void* resSpc = _IRR_ALIGNED_MALLOC(core::GeneralpurposeAddressAllocator<uint32_t>::reserved_size(alignof(uint32_t), 16u, 1u), _IRR_SIMD_ALIGNMENT);
312-
auto alctr = core::GeneralpurposeAddressAllocator<uint32_t>(resSpc, 0u, 0u, alignof(uint32_t), 16u, 1u);
313-
alctr.safe_shrink_size(8u);
314-
_IRR_ALIGNED_FREE(resSpc);
315-
}
316-
317-
//3
318-
{
319-
void* resSpc = _IRR_ALIGNED_MALLOC(core::GeneralpurposeAddressAllocator<uint32_t>::reserved_size(alignof(uint32_t), 1413, 32), _IRR_SIMD_ALIGNMENT);
320-
auto alctr = core::GeneralpurposeAddressAllocator<uint32_t>(resSpc, 0u, 0u, alignof(uint32_t), 1413, 32);
321-
322-
auto a = alctr.alloc_addr(1401, 1);
323-
_IRR_ALIGNED_FREE(resSpc);
324-
}
325-
326-
return 0;
327-
}
328-
#endif
329-
330281
#ifdef ADDRESS_ALLOCATOR_TRAITS_TEST
331282

332283
int main()

0 commit comments

Comments
 (0)