From 6f93ce8d02d61fb676a627791a33049d4dc02d03 Mon Sep 17 00:00:00 2001 From: lkct Date: Mon, 11 Jul 2022 21:23:21 +0100 Subject: [PATCH] fix aligned delete --- hs_detection/detect/Detection.cpp | 4 ++-- hs_detection/detect/RollingArray.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hs_detection/detect/Detection.cpp b/hs_detection/detect/Detection.cpp index db20f7f..2f52779 100644 --- a/hs_detection/detect/Detection.cpp +++ b/hs_detection/detect/Detection.cpp @@ -61,8 +61,8 @@ namespace HSDetection delete[] spikeArea; delete[] hasAHP; - delete[] scale; - delete[] offset; + operator delete[](scale, align_val_t(channelAlign * sizeof(IntVolt))); + operator delete[](offset, align_val_t(channelAlign * sizeof(IntVolt))); } void Detection::step(FloatRaw *traceBuffer, IntFrame chunkStart, IntFrame chunkLen) diff --git a/hs_detection/detect/RollingArray.h b/hs_detection/detect/RollingArray.h index e451dc9..c492359 100644 --- a/hs_detection/detect/RollingArray.h +++ b/hs_detection/detect/RollingArray.h @@ -32,7 +32,7 @@ namespace HSDetection { arrayBuffer = new (memAlign) IntVolt[(IntCalc)(frameMask + 1) * numChannels]; } - ~RollingArray() { delete[] arrayBuffer; } + ~RollingArray() { operator delete[](arrayBuffer, memAlign); } // copy constructor deleted to protect buffer RollingArray(const RollingArray &) = delete;