mirror of https://gitee.com/openkylin/qemu.git
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
|
@ -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…
Reference in New Issue