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
cade53a5
Commit
cade53a5
authored
7 years ago
by
Kostyantyn Vorobyov
Browse files
Options
Downloads
Patches
Plain Diff
Aligned alloc in dlmalloc
parent
0d25c8c1
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/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
+27
-0
27 additions, 0 deletions
src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
with
27 additions
and
0 deletions
src/plugins/e-acsl/contrib/libdlmalloc/dlmalloc.c
+
27
−
0
View file @
cade53a5
...
...
@@ -819,6 +819,7 @@ extern "C" {
#define mspace_realloc mspace_prefix(mspace_realloc)
#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_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)
...
...
@@ -848,6 +849,7 @@ extern "C" {
#define dlmalloc malloc
#define dlmemalign memalign
#define dlposix_memalign posix_memalign
#define dlaligned_alloc aligned_alloc
#define dlrealloc realloc
#define dlrealloc_in_place realloc_in_place
#define dlvalloc valloc
...
...
@@ -962,6 +964,13 @@ DLMALLOC_EXPORT void* dlmemalign(size_t, size_t);
*/
DLMALLOC_EXPORT
int
dlposix_memalign
(
void
**
,
size_t
,
size_t
);
/*
aligned_alloc(size_t alignment, size_t size);
The function aligned_alloc() is the same as memalign(), except for the added
restriction that size should be a multiple of alignment.
*/
DLMALLOC_EXPORT
void
*
dlaligned_alloc
(
size_t
alignment
,
size_t
size
);
/*
valloc(size_t n);
Equivalent to memalign(pagesize, n), where pagesize is the page
...
...
@@ -1384,6 +1393,12 @@ DLMALLOC_EXPORT void* mspace_calloc(mspace msp, size_t n_elements, size_t elem_s
*/
DLMALLOC_EXPORT
void
*
mspace_memalign
(
mspace
msp
,
size_t
alignment
,
size_t
bytes
);
/*
mspace_aligned_alloc behaves as aligned_alloc, but operates within
the given space.
*/
DLMALLOC_EXPORT
void
*
mspace_aligned_alloc
(
mspace
msp
,
size_t
alignment
,
size_t
bytes
);
/*
mspace_independent_calloc behaves as independent_calloc, but
operates within the given space.
...
...
@@ -5295,6 +5310,12 @@ void* dlmemalign(size_t alignment, size_t bytes) {
return
internal_memalign
(
gm
,
alignment
,
bytes
);
}
void
*
dlaligned_alloc
(
size_t
alignment
,
size_t
size
)
{
if
(
size
%
alignment
)
return
NULL
;
return
dlmemalign
(
alignment
,
size
);
}
int
dlposix_memalign
(
void
**
pp
,
size_t
alignment
,
size_t
bytes
)
{
void
*
mem
=
0
;
if
(
alignment
==
MALLOC_ALIGNMENT
)
...
...
@@ -5850,6 +5871,12 @@ void* mspace_memalign(mspace msp, size_t alignment, size_t bytes) {
return
internal_memalign
(
ms
,
alignment
,
bytes
);
}
void
*
mspace_aligned_alloc
(
mspace
msp
,
size_t
alignment
,
size_t
bytes
)
{
if
(
bytes
%
alignment
)
return
NULL
;
return
mspace_aligned_alloc
(
msp
,
alignment
,
bytes
);
}
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