Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
FORMUS3IC_LAS3
/
embb
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9c3629c3
authored
Jan 19, 2015
by
Marcus Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
containers_cpp: fixed memory leak in test, check for memory leaks after tests
parent
a2efb0db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
+13
-1
containers_cpp/test/hazard_pointer_test.cc
+8
-1
containers_cpp/test/hazard_pointer_test.h
+1
-0
containers_cpp/test/main.cc
+4
-0
No files found.
containers_cpp/test/hazard_pointer_test.cc
View file @
9c3629c3
...
@@ -60,7 +60,8 @@ n_threads(static_cast<int>
...
@@ -60,7 +60,8 @@ n_threads(static_cast<int>
Pre
(
&
HazardPointerTest
::
HazardPointerTest1_Pre
,
this
).
Pre
(
&
HazardPointerTest
::
HazardPointerTest1_Pre
,
this
).
Add
(
Add
(
&
HazardPointerTest
::
HazardPointerTest1_ThreadMethod
,
&
HazardPointerTest
::
HazardPointerTest1_ThreadMethod
,
this
,
static_cast
<
size_t
>
(
n_threads
));
this
,
static_cast
<
size_t
>
(
n_threads
)).
Post
(
&
HazardPointerTest
::
HazardPointerTest1_Post
,
this
);
}
}
void
HazardPointerTest
::
HazardPointerTest1_Pre
()
{
void
HazardPointerTest
::
HazardPointerTest1_Pre
()
{
...
@@ -75,6 +76,12 @@ void HazardPointerTest::HazardPointerTest1_Pre() {
...
@@ -75,6 +76,12 @@ void HazardPointerTest::HazardPointerTest1_Pre() {
1
);
1
);
}
}
void
HazardPointerTest
::
HazardPointerTest1_Post
()
{
delete
object_pool
;
delete
stack
;
delete
hp
;
}
void
HazardPointerTest
::
HazardPointerTest1_ThreadMethod
()
{
void
HazardPointerTest
::
HazardPointerTest1_ThreadMethod
()
{
unsigned
int
thread_index
;
unsigned
int
thread_index
;
embb_internal_thread_index
(
&
thread_index
);
embb_internal_thread_index
(
&
thread_index
);
...
...
containers_cpp/test/hazard_pointer_test.h
View file @
9c3629c3
...
@@ -59,6 +59,7 @@ class HazardPointerTest : public partest::TestCase {
...
@@ -59,6 +59,7 @@ class HazardPointerTest : public partest::TestCase {
*/
*/
HazardPointerTest
();
HazardPointerTest
();
void
HazardPointerTest1_Pre
();
void
HazardPointerTest1_Pre
();
void
HazardPointerTest1_Post
();
void
HazardPointerTest1_ThreadMethod
();
void
HazardPointerTest1_ThreadMethod
();
void
DeletePointerCallback
(
embb
::
base
::
Atomic
<
int
>*
to_delete
);
void
DeletePointerCallback
(
embb
::
base
::
Atomic
<
int
>*
to_delete
);
};
};
...
...
containers_cpp/test/main.cc
View file @
9c3629c3
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
#include <embb/containers/lock_free_stack.h>
#include <embb/containers/lock_free_stack.h>
#include <embb/containers/lock_free_mpmc_queue.h>
#include <embb/containers/lock_free_mpmc_queue.h>
#include <embb/base/c/memory_allocation.h>
#define COMMA ,
#define COMMA ,
PT_MAIN
(
"Data Structures C++"
)
{
PT_MAIN
(
"Data Structures C++"
)
{
...
@@ -67,4 +69,6 @@ PT_MAIN("Data Structures C++") {
...
@@ -67,4 +69,6 @@ PT_MAIN("Data Structures C++") {
PT_RUN
(
embb
::
containers
::
test
::
ObjectPoolTest
PT_RUN
(
embb
::
containers
::
test
::
ObjectPoolTest
<
embb
::
containers
::
WaitFreeArrayValuePool
<
bool
COMMA
false
>
>
);
<
embb
::
containers
::
WaitFreeArrayValuePool
<
bool
COMMA
false
>
>
);
PT_EXPECT
(
embb_get_bytes_allocated
()
==
0
);
}
}
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