mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 04:12:52 +08:00
core: update allocSingleton implementation, valgrind suppression
This commit is contained in:
parent
0101fa789c
commit
18bf91a08b
@ -142,9 +142,13 @@ namespace cv
|
||||
CV_EXPORTS void scalarToRawData(const cv::Scalar& s, void* buf, int type, int unroll_to = 0);
|
||||
|
||||
//! Allocate all memory buffers which will not be freed, ease filtering memcheck issues
|
||||
template <typename T>
|
||||
T* allocSingleton(size_t count) { return static_cast<T*>(fastMalloc(sizeof(T) * count)); }
|
||||
}
|
||||
CV_EXPORTS void* allocSingletonBuffer(size_t size);
|
||||
|
||||
//! Allocate all memory buffers which will not be freed, ease filtering memcheck issues
|
||||
template <typename T> static inline
|
||||
T* allocSingleton(size_t count = 1) { return static_cast<T*>(allocSingletonBuffer(sizeof(T) * count)); }
|
||||
|
||||
} // namespace
|
||||
|
||||
#if 1 // TODO: Remove in OpenCV 4.x
|
||||
|
||||
|
@ -70,6 +70,8 @@ static bool param_dumpErrors = utils::getConfigurationParameterBool("OPENCV_DUMP
|
||||
#endif
|
||||
);
|
||||
|
||||
void* allocSingletonBuffer(size_t size) { return fastMalloc(size); }
|
||||
|
||||
} // namespace cv
|
||||
|
||||
#ifndef CV_ERROR_SET_TERMINATE_HANDLER // build config option
|
||||
|
@ -12,6 +12,13 @@
|
||||
fun:_ZN2cv22getInitializationMutexEv
|
||||
}
|
||||
|
||||
{
|
||||
OpenCV-SingletonBuffer
|
||||
Memcheck:Leak
|
||||
...
|
||||
fun:_ZN2cv20allocSingletonBufferEm
|
||||
}
|
||||
|
||||
{
|
||||
OpenCV-getStdAllocator
|
||||
Memcheck:Leak
|
||||
|
Loading…
Reference in New Issue
Block a user