Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
f4c041f9
Commit
f4c041f9
authored
7 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
posix_memalign in dlmalloc
parent
cade53a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
+20
-0
20 additions, 0 deletions
src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
with
20 additions
and
0 deletions
src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
+
20
−
0
View file @
f4c041f9
...
...
@@ -820,6 +820,7 @@ extern "C" {
#define mspace_realloc_in_place mspace_prefix(mspace_realloc_in_place)
#define mspace_memalign mspace_prefix(mspace_memalign)
#define mspace_aligned_alloc mspace_prefix(mspace_aligned_alloc)
#define mspace_posix_memalign mspace_prefix(mspace_posix_memalign)
#define mspace_independent_calloc mspace_prefix(mspace_independent_calloc)
#define mspace_independent_comalloc mspace_prefix(mspace_independent_comalloc)
#define mspace_bulk_free mspace_prefix(mspace_bulk_free)
...
...
@@ -1399,6 +1400,12 @@ DLMALLOC_EXPORT void* mspace_memalign(mspace msp, size_t alignment, size_t bytes
*/
DLMALLOC_EXPORT
void
*
mspace_aligned_alloc
(
mspace
msp
,
size_t
alignment
,
size_t
bytes
);
/*
mspace_posix_memalign behaves as posix_memalign, but operates within
the given space.
*/
DLMALLOC_EXPORT
int
mspace_posix_memalign
(
mspace
msp
,
void
**
pp
,
size_t
alignment
,
size_t
bytes
);
/*
mspace_independent_calloc behaves as independent_calloc, but
operates within the given space.
...
...
@@ -5877,6 +5884,19 @@ void* mspace_aligned_alloc(mspace msp, size_t alignment, size_t bytes) {
return
mspace_aligned_alloc
(
msp
,
alignment
,
bytes
);
}
int
mspace_posix_memalign
(
mspace
msp
,
void
**
memptr
,
size_t
alignment
,
size_t
bytes
)
{
if
(
bytes
==
0
)
{
*
memptr
=
NULL
;
return
0
;
}
void
*
res
=
mspace_aligned_alloc
(
msp
,
alignment
,
bytes
);
if
(
res
)
{
*
memptr
=
res
;
return
0
;
}
return
1
;
}
void
**
mspace_independent_calloc
(
mspace
msp
,
size_t
n_elements
,
size_t
elem_size
,
void
*
chunks
[])
{
size_t
sz
=
elem_size
;
/* serves as 1-element array */
...
...
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