@@ -106,7 +106,7 @@ class AllocatorHandler
106
106
else
107
107
{
108
108
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 );
110
110
alctr = AlctrType (reservedSpace, randAllocParams.offset , randAllocParams.alignOffset , randAllocParams.maxAlign , randAllocParams.addressSpaceSize , randAllocParams.blockSz );
111
111
}
112
112
@@ -171,7 +171,7 @@ class AllocatorHandler
171
171
}
172
172
173
173
if constexpr (!std::is_same<AlctrType, core::LinearAddressAllocator<uint32_t >>::value)
174
- _IRR_ALIGNED_FREE (reservedSpace);
174
+ _NBL_ALIGNED_FREE (reservedSpace);
175
175
176
176
}
177
177
@@ -278,55 +278,6 @@ int main()
278
278
279
279
#endif
280
280
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
-
330
281
#ifdef ADDRESS_ALLOCATOR_TRAITS_TEST
331
282
332
283
int main ()
0 commit comments