Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openfpm_devices
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sbalzarini Lab
Software
Parallel Computing
OpenFPM
openfpm_devices
Commits
4f77d838
Commit
4f77d838
authored
9 years ago
by
tonynsyde
Browse files
Options
Downloads
Patches
Plain Diff
Added constructor
parent
990728ad
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/memory/ExtPreAlloc.hpp
+15
-1
15 additions, 1 deletion
src/memory/ExtPreAlloc.hpp
with
15 additions
and
1 deletion
src/memory/ExtPreAlloc.hpp
+
15
−
1
View file @
4f77d838
...
...
@@ -97,6 +97,19 @@ public:
mem
.
allocate
(
total_size
);
}
/*! \brief Preallocated memory sequence
*
* \param size number of bytes
* \param mem external memory, used if you want to keep the memory
*
*/
ExtPreAlloc
(
size_t
size
,
Mem
&
mem
)
:
a_seq
(
0
),
mem
(
&
mem
),
ref_cnt
(
0
)
{
// Allocate the total size of memory
mem
.
allocate
(
size
);
}
//! Increment the reference counter
virtual
void
incRef
()
{
ref_cnt
++
;}
...
...
@@ -120,6 +133,7 @@ public:
*/
virtual
bool
allocate
(
size_t
sz
)
{
// Zero sized allocation are ignored
if
(
sz
==
0
)
return
true
;
...
...
@@ -189,7 +203,7 @@ public:
return
allocate
(
sz
);
}
/*! \brief Get the size of the allocated memory
/*! \brief Get the size of the
LAST
allocated memory
*
* Get the size of the allocated memory
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment