Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xenomai
xenomai
Commits
0064fa87
Commit
0064fa87
authored
May 15, 2018
by
Philippe Gerum
Browse files
boilerplate/heapmem: align on HEAPMEM_PAGE_SIZE for non-bucketed blocks
parent
d7256d38
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/boilerplate/heapmem.c
View file @
0064fa87
...
...
@@ -426,9 +426,12 @@ void *heapmem_alloc(struct heap_memory *heap, size_t size)
log2size
=
HEAPMEM_MIN_LOG2
;
}
else
{
log2size
=
sizeof
(
size
)
*
CHAR_BIT
-
1
-
__clz
(
size
);
if
(
log2size
<
HEAPMEM_PAGE_SHIFT
)
{
if
(
size
&
(
size
-
1
))
log2size
++
;
bsize
=
1
<<
log2size
;
}
else
bsize
=
__align_to
(
size
,
HEAPMEM_PAGE_SIZE
);
}
/*
...
...
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