1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

core(buffer_area): handle 'OPENCV_ENABLE_MEMORY_SANITIZER=ON' case

This commit is contained in:
Alexander Alekhin
2020-03-16 19:34:08 +03:00
parent 8f49b820db
commit 77d1c20fb7
2 changed files with 32 additions and 10 deletions
@@ -72,6 +72,10 @@ public:
CV_Assert(alignment % sizeof(T) == 0);
CV_Assert((alignment & (alignment - 1)) == 0);
allocate_((void**)(&ptr), static_cast<ushort>(sizeof(T)), count, alignment);
#ifndef OPENCV_ENABLE_MEMORY_SANITIZER
if (safe)
#endif
CV_Assert(ptr != NULL);
}
/** @brief Fill one of buffers with zeroes
@@ -118,9 +122,11 @@ private:
private:
class Block;
std::vector<Block> blocks;
#ifndef OPENCV_ENABLE_MEMORY_SANITIZER
void * oneBuf;
size_t totalSize;
const bool safe;
#endif
};
//! @}