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
c8fda634
Commit
c8fda634
authored
9 years ago
by
Pietro Incardona
Browse files
Options
Downloads
Patches
Plain Diff
Add functionalities to ExtMemAlloc
parent
74b215b2
No related branches found
Branches containing commit
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
+18
-6
18 additions, 6 deletions
src/memory/ExtPreAlloc.hpp
with
18 additions
and
6 deletions
src/memory/ExtPreAlloc.hpp
+
18
−
6
View file @
c8fda634
...
...
@@ -134,9 +134,9 @@ public:
return
true
;
}
/*! \brief Return
a readabl
e pointer
with your data
/*! \brief Return
th
e pointer
of the last allocation
*
*
R
eturn
a readable pointer with your data
*
\r
eturn
the pointer
*
*/
virtual
void
*
getPointer
()
...
...
@@ -144,17 +144,29 @@ public:
if
(
a_seq
==
0
)
return
NULL
;
return
(((
unsigned
char
*
)
mem
->
getPointer
())
+
sequence_c
[
a_seq
-
1
]);
return
(((
unsigned
char
*
)
mem
->
getPointer
())
+
sequence_c
[
a_seq
-
1
]);
}
/*! \brief Return a readable pointer with your data
/*! \brief Return the pointer you will get when you do the allocation ip
*
* This particular function exist because the allocation sequence is fixed a priori
*
* \param ip index of the pointer in the sequence
*
*/
virtual
void
*
getPointer
(
size_t
ip
)
void
*
getPointer
(
size_t
ip
)
{
return
(((
unsigned
char
*
)
mem
->
getPointer
())
+
sequence_c
[
ip
]);
}
/*! \brief Get the base memory pointer increased with an offset
*
* \param offset memory offset
*
*/
void
*
getPointerOffset
(
size_t
offset
)
{
return
(((
unsigned
char
*
)
mem
->
getPointer
())
+
sequence_c
[
ip
]
);
return
(((
unsigned
char
*
)
mem
->
getPointer
())
+
offset
);
}
/*! \brief Allocate or resize 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