Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
0e4a78c0
Commit
0e4a78c0
authored
May 15, 2013
by
dchh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed nasty bug w/ large actor classes, fixes #88
parent
6e57254e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
cppa/detail/memory.hpp
cppa/detail/memory.hpp
+6
-2
No files found.
cppa/detail/memory.hpp
View file @
0e4a78c0
...
@@ -48,6 +48,7 @@ namespace cppa { namespace detail {
...
@@ -48,6 +48,7 @@ namespace cppa { namespace detail {
namespace
{
namespace
{
constexpr
size_t
s_alloc_size
=
1024
;
// allocate ~1kb chunks
constexpr
size_t
s_alloc_size
=
1024
;
// allocate ~1kb chunks
constexpr
size_t
s_min_elements
=
5
;
// don't create less than 5 elements
constexpr
size_t
s_cache_size
=
10240
;
// cache about 10kb per thread
constexpr
size_t
s_cache_size
=
10240
;
// cache about 10kb per thread
}
// namespace <anonymous>
}
// namespace <anonymous>
...
@@ -96,6 +97,9 @@ class basic_memory_cache : public memory_cache {
...
@@ -96,6 +97,9 @@ class basic_memory_cache : public memory_cache {
class
storage
:
public
ref_counted
{
class
storage
:
public
ref_counted
{
static
constexpr
size_t
ne
=
s_alloc_size
/
sizeof
(
T
);
static
constexpr
size_t
dsize
=
ne
>
s_min_elements
?
ne
:
s_min_elements
;
public:
public:
storage
()
{
storage
()
{
...
@@ -110,11 +114,11 @@ class basic_memory_cache : public memory_cache {
...
@@ -110,11 +114,11 @@ class basic_memory_cache : public memory_cache {
iterator
begin
()
{
return
data
;
}
iterator
begin
()
{
return
data
;
}
iterator
end
()
{
return
begin
()
+
(
s_alloc_size
/
sizeof
(
T
))
;
}
iterator
end
()
{
return
begin
()
+
dsize
;
}
private:
private:
wrapper
data
[
s_alloc_size
/
sizeof
(
T
)
];
wrapper
data
[
dsize
];
};
};
...
...
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