@@ -467,7 +467,7 @@ int32_t GPUReconstruction::Exit()
467467 if (mMemoryResources [i].mReuse >= 0 ) {
468468 continue ;
469469 }
470- :: operator delete ( mMemoryResources [i].mPtrDevice , std::align_val_t (constants::GPU_BUFFER_ALIGNMENT) );
470+ alignedDefaultBufferDeleter ()( mMemoryResources [i].mPtrDevice );
471471 mMemoryResources [i].mPtr = mMemoryResources [i].mPtrDevice = nullptr ;
472472 }
473473 }
@@ -630,7 +630,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
630630 if (GetProcessingSettings ().memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && (control == nullptr || control->useInternal ())) {
631631 if (!(res->mType & GPUMemoryResource::MEMORY_EXTERNAL)) {
632632 if (res->mPtrDevice && res->mReuse < 0 ) {
633- :: operator delete ( res->mPtrDevice , std::align_val_t (constants::GPU_BUFFER_ALIGNMENT) );
633+ alignedDefaultBufferDeleter ()( res->mPtrDevice );
634634 }
635635 res->mSize = std::max ((size_t )res->SetPointers ((void *)1 ) - 1 , res->mOverrideSize );
636636 if (res->mReuse >= 0 ) {
@@ -640,7 +640,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
640640 }
641641 res->mPtrDevice = mMemoryResources [res->mReuse ].mPtrDevice ;
642642 } else {
643- res->mPtrDevice = :: operator new (res->mSize + constants::GPU_BUFFER_ALIGNMENT, std::align_val_t (constants::GPU_BUFFER_ALIGNMENT) );
643+ res->mPtrDevice = alignedDefaultBufferAllocator< char > (res->mSize + constants::GPU_BUFFER_ALIGNMENT);
644644 }
645645 res->mPtr = GPUProcessor::alignPointer<constants::GPU_BUFFER_ALIGNMENT>(res->mPtrDevice );
646646 res->SetPointers (res->mPtr );
@@ -731,7 +731,7 @@ void* GPUReconstruction::AllocateDirectMemory(size_t size, int32_t type)
731731{
732732 stdspinlock spinlock (mMemoryMutex );
733733 if (GetProcessingSettings ().memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL) {
734- char * retVal = new ( std::align_val_t (constants::GPU_BUFFER_ALIGNMENT)) char [ size] ;
734+ char * retVal = alignedDefaultBufferAllocator< char >( size) ;
735735 if ((type & GPUMemoryResource::MEMORY_STACK)) {
736736 mNonPersistentIndividualDirectAllocations .emplace_back (retVal, alignedDefaultBufferDeleter ());
737737 } else {
@@ -796,7 +796,7 @@ void* GPUReconstruction::AllocateVolatileMemory(size_t size, bool device)
796796 if (device) {
797797 return AllocateVolatileDeviceMemory (size);
798798 }
799- char * retVal = new ( std::align_val_t (constants::GPU_BUFFER_ALIGNMENT)) char [ size] ;
799+ char * retVal = alignedDefaultBufferAllocator< char >( size) ;
800800 stdspinlock spinlock (mMemoryMutex );
801801 mVolatileChunks .emplace_back (retVal, alignedDefaultBufferDeleter ());
802802 return retVal;
@@ -876,7 +876,7 @@ void GPUReconstruction::FreeRegisteredMemory(GPUMemoryResource* res)
876876 std::cout << " Freeing " << res->mName << " : size " << res->mSize << " (reused " << res->mReuse << " )\n " ;
877877 }
878878 if (GetProcessingSettings ().memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && res->mReuse < 0 ) {
879- :: operator delete ( res->mPtrDevice , std::align_val_t (constants::GPU_BUFFER_ALIGNMENT) );
879+ alignedDefaultBufferDeleter ()( res->mPtrDevice );
880880 }
881881 res->mPtr = nullptr ;
882882 res->mPtrDevice = nullptr ;
@@ -916,7 +916,7 @@ void GPUReconstruction::PopNonPersistentMemory(RecoStep step, uint64_t tag, cons
916916 std::cout << " Freeing NonPersistent " << res->mName << " : size " << res->mSize << " (reused " << res->mReuse << " )\n " ;
917917 }
918918 if (res->mReuse < 0 ) {
919- :: operator delete ( res->mPtrDevice , std::align_val_t (constants::GPU_BUFFER_ALIGNMENT) );
919+ alignedDefaultBufferDeleter ()( res->mPtrDevice );
920920 }
921921 res->mPtr = nullptr ;
922922 res->mPtrDevice = nullptr ;
0 commit comments