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
db969583
authored
Oct 23, 2015
by
Christian Kern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implementation for jira ticket #520
parent
a74b7bac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
2 deletions
+35
-2
containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h
+8
-0
containers_cpp/include/embb/containers/internal/object_pool-inl.h
+3
-2
containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h
+8
-0
containers_cpp/include/embb/containers/lock_free_tree_value_pool.h
+8
-0
containers_cpp/include/embb/containers/wait_free_array_value_pool.h
+8
-0
No files found.
containers_cpp/include/embb/containers/internal/lock_free_tree_value_pool-inl.h
View file @
db969583
...
@@ -269,6 +269,14 @@ LockFreeTreeValuePool<Type, Undefined, PoolAllocator, TreeAllocator>::
...
@@ -269,6 +269,14 @@ LockFreeTreeValuePool<Type, Undefined, PoolAllocator, TreeAllocator>::
}
}
}
}
template
<
typename
Type
,
Type
Undefined
,
class
PoolAllocator
,
class
TreeAllocator
>
size_t
LockFreeTreeValuePool
<
Type
,
Undefined
,
PoolAllocator
,
TreeAllocator
>::
GetMinimumElementCountForGuaranteedCapacity
(
size_t
capacity
)
{
// for this value pool, this is just capacity...
return
capacity
;
}
}
// namespace containers
}
// namespace containers
}
// namespace embb
}
// namespace embb
...
...
containers_cpp/include/embb/containers/internal/object_pool-inl.h
View file @
db969583
...
@@ -117,8 +117,9 @@ size_t ObjectPool<Type, ValuePool, ObjectAllocator>::GetCapacity() {
...
@@ -117,8 +117,9 @@ size_t ObjectPool<Type, ValuePool, ObjectAllocator>::GetCapacity() {
template
<
class
Type
,
typename
ValuePool
,
class
ObjectAllocator
>
template
<
class
Type
,
typename
ValuePool
,
class
ObjectAllocator
>
ObjectPool
<
Type
,
ValuePool
,
ObjectAllocator
>::
ObjectPool
(
size_t
capacity
)
:
ObjectPool
<
Type
,
ValuePool
,
ObjectAllocator
>::
ObjectPool
(
size_t
capacity
)
:
capacity
(
capacity
),
capacity
(
capacity
),
p
(
ReturningTrueIterator
(
0
),
ReturningTrueIterator
(
capacity
))
{
p
(
ReturningTrueIterator
(
0
),
ReturningTrueIterator
(
ValuePool
::
GetMinimumElementCountForGuaranteedCapacity
(
capacity
)))
{
// Allocate the objects (without construction, just get the memory)
// Allocate the objects (without construction, just get the memory)
objects
=
objectAllocator
.
allocate
(
capacity
);
objects
=
objectAllocator
.
allocate
(
capacity
);
}
}
...
...
containers_cpp/include/embb/containers/internal/wait_free_array_value_pool-inl.h
View file @
db969583
...
@@ -95,6 +95,14 @@ WaitFreeArrayValuePool<Type, Undefined, Allocator>::~WaitFreeArrayValuePool() {
...
@@ -95,6 +95,14 @@ WaitFreeArrayValuePool<Type, Undefined, Allocator>::~WaitFreeArrayValuePool() {
// free memory
// free memory
allocator
.
deallocate
(
pool
,
static_cast
<
size_t
>
(
size
));
allocator
.
deallocate
(
pool
,
static_cast
<
size_t
>
(
size
));
}
}
template
<
typename
Type
,
Type
Undefined
,
class
Allocator
>
size_t
WaitFreeArrayValuePool
<
Type
,
Undefined
,
Allocator
>::
GetMinimumElementCountForGuaranteedCapacity
(
size_t
capacity
)
{
// for this value pool, this is just capacity...
return
capacity
;
}
}
// namespace containers
}
// namespace containers
}
// namespace embb
}
// namespace embb
...
...
containers_cpp/include/embb/containers/lock_free_tree_value_pool.h
View file @
db969583
...
@@ -278,6 +278,14 @@ class LockFreeTreeValuePool {
...
@@ -278,6 +278,14 @@ class LockFreeTreeValuePool {
);
);
/**
/**
* Due to concurrency effects, a pool might provide less elements than managed
* by it. However, usually one wants to guarantee a minimal capacity. The
* count of elements, that must be given to the pool when to guarantee \c
* capacity elements is computed using this function.
*/
static
size_t
GetMinimumElementCountForGuaranteedCapacity
(
size_t
capacity
);
/**
* Destructs the pool.
* Destructs the pool.
*
*
* \notthreadsafe
* \notthreadsafe
...
...
containers_cpp/include/embb/containers/wait_free_array_value_pool.h
View file @
db969583
...
@@ -150,6 +150,14 @@ class WaitFreeArrayValuePool {
...
@@ -150,6 +150,14 @@ class WaitFreeArrayValuePool {
);
);
/**
/**
* Due to concurrency effects, a pool might provide less elements than managed
* by it. However, usually one wants to guarantee a minimal capacity. The
* count of elements, that must be given to the pool when to guarantee \c
* capacity elements is computed using this function.
*/
static
size_t
GetMinimumElementCountForGuaranteedCapacity
(
size_t
capacity
);
/**
* Destructs the pool.
* Destructs the pool.
*
*
* \notthreadsafe
* \notthreadsafe
...
...
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