mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
libqos: Correct mask to align size to PAGE_SIZE in malloc-pc
Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
ae74f18782
commit
f75ffc5857
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size)
|
|||
|
||||
|
||||
size += (PAGE_SIZE - 1);
|
||||
size &= PAGE_SIZE;
|
||||
size &= -PAGE_SIZE;
|
||||
|
||||
g_assert_cmpint((s->start + size), <=, s->end);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue