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:
Marc Marí 2014-08-12 13:41:49 +02:00 committed by Stefan Hajnoczi
parent ae74f18782
commit f75ffc5857

View File

@ -36,7 +36,7 @@ static uint64_t pc_alloc(QGuestAllocator *allocator, size_t size)
size += (PAGE_SIZE - 1); size += (PAGE_SIZE - 1);
size &= PAGE_SIZE; size &= -PAGE_SIZE;
g_assert_cmpint((s->start + size), <=, s->end); g_assert_cmpint((s->start + size), <=, s->end);