projects
/
profile
/
ivi
/
pulseaudio-panda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68f3ca9
)
macro: make pa_page_align roung up instead of down
author
Lennart Poettering
<lennart@poettering.net>
Tue, 28 Apr 2009 23:52:28 +0000
(
01:52
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 28 Apr 2009 23:52:28 +0000
(
01:52
+0200)
src/pulsecore/macro.h
patch
|
blob
|
history
diff --git
a/src/pulsecore/macro.h
b/src/pulsecore/macro.h
index
2f6ee90
..
73438e6
100644
(file)
--- a/
src/pulsecore/macro.h
+++ b/
src/pulsecore/macro.h
@@
-75,8
+75,9
@@
static inline void* pa_page_align_ptr(const void *p) {
}
#define PA_PAGE_ALIGN_PTR(x) (pa_page_align_ptr(x))
+/* Rounds up */
static inline size_t pa_page_align(size_t l) {
- return
l & ~(PA_PAGE_SIZE-1)
;
+ return
((l + PA_PAGE_SIZE - 1) / PA_PAGE_SIZE) * PA_PAGE_SIZE
;
}
#define PA_PAGE_ALIGN(x) (pa_page_align(x))