VirtualBox

Changeset 21007 in vbox for trunk


Ignore:
Timestamp:
Jun 28, 2009 7:18:09 PM (16 years ago)
Author:
vboxsync
Message:

VHD: Aligning the block bitmap size doesn't work because the accesses to the bitmap are unaligned too.

We need to always add 4 or 8 bytes and not only when the size is not aligned already.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp

    r21006 r21007  
    229229{
    230230#ifdef RT_ARCH_AMD64
    231     return (uint8_t *)RTMemAllocZ(RT_ALIGN_64(pImage->cbDataBlockBitmap, 8));
     231    return (uint8_t *)RTMemAllocZ(pImage->cbDataBlockBitmap + 8);
    232232#else
    233     return (uint8_t *)RTMemAllocZ(RT_ALIGN_32(pImage->cbDataBlockBitmap, 4));
     233    return (uint8_t *)RTMemAllocZ(pImage->cbDataBlockBitmap + 4);
    234234#endif
    235235}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette