Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
18bf91a0
Commit
18bf91a0
authored
Oct 05, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: update allocSingleton implementation, valgrind suppression
parent
0101fa78
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
3 deletions
+16
-3
private.hpp
modules/core/include/opencv2/core/private.hpp
+7
-3
system.cpp
modules/core/src/system.cpp
+2
-0
valgrind.supp
platforms/scripts/valgrind.supp
+7
-0
No files found.
modules/core/include/opencv2/core/private.hpp
View file @
18bf91a0
...
...
@@ -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
...
...
modules/core/src/system.cpp
View file @
18bf91a0
...
...
@@ -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
...
...
platforms/scripts/valgrind.supp
View file @
18bf91a0
...
...
@@ -12,6 +12,13 @@
fun:_ZN2cv22getInitializationMutexEv
}
{
OpenCV-SingletonBuffer
Memcheck:Leak
...
fun:_ZN2cv20allocSingletonBufferEm
}
{
OpenCV-getStdAllocator
Memcheck:Leak
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment