mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
macro: make pa_page_align roung up instead of down
This commit is contained in:
parent
68f3ca9831
commit
bd0e4ceb85
1 changed files with 2 additions and 1 deletions
|
|
@ -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))
|
#define PA_PAGE_ALIGN_PTR(x) (pa_page_align_ptr(x))
|
||||||
|
|
||||||
|
/* Rounds up */
|
||||||
static inline size_t pa_page_align(size_t l) {
|
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))
|
#define PA_PAGE_ALIGN(x) (pa_page_align(x))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue