• Vicențiu Ciorbaru's avatar
    Fix MIPS build failure: Handle unaligned buffers in connect's TYPBLK class · a33c1082
    Vicențiu Ciorbaru authored
    On MIPS platforms (and probably others) unaligned memory access results in a
    bus error. In the connect storage engine, block data for some data formats is
    stored packed in memory and the TYPBLK class is used to read values from it.
    Since TYPBLK does not have special handling for this packed memory, it can
    quite easily result in unaligned memory accesses.
    
    The simple way to fix this is to perform all accesses to the main buffer
    through memcpy. With GCC and optimizations turned on, this call to memcpy is
    completely optimized away on architectures where unaligned accesses are ok
    (like x86).
    
    Contributors:
    James Cowgill <jcowgill@debian.org>
    a33c1082
valblk.cpp 45.1 KB