Skip to content
Snippets Groups Projects
Select Git revision
  • branch/default-vms default
  • master
  • wild/10bb54beb20b1f91e3f2255e493ed487461567df
  • branch/default protected
  • wild/831adee19701cacab32ef85896327b5d448246ad
  • wild/09ba00b33babd0cc770b62edfc413300f8fceaa9
  • wild/4137bb2d8fe3be974d16b6b2938cb2b7ac3e9236
  • wild/e2872ee3300e31ba8cf288443557bbfd686361aa
  • branch/2.7-vms
  • wild/c73e2483e818fd3d24b50b422ab223940b2423f5
  • wild/2e4b3b039e86fc242c3d94dabbfa67173c291802
  • wild/3c5bb819718be406903a9b5a1628eda4c847707e
  • 2.7.14-vms
  • 2.7.15+-vms
  • 2.7.16+-vms
  • 2.7.17-vms
  • 2.7.18-vms
17 results

configure.ac

  • Jessica Clarke's avatar
    6f48cece8020
    bpo-43179: Generalise alignment for optimised string routines (GH-24624) · 6f48cece8020
    Jessica Clarke authored
    * Remove m68k-specific hack from ascii_decode
    
    On m68k, alignments of primitives is more relaxed, with 4-byte and
    8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
    does not work. Instead, use the portable alternative.
    
    Note that this is a minimal fix that only relaxes the assertion and the
    condition for when to use the optimised version remains overly strict.
    Such issues will be fixed tree-wide in the next commit.
    
    NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
    we use autoconf.
    
    * Optimise string routines for architectures with non-natural alignment
    
    C only requires that sizeof(x) is a multiple of alignof(x), not that the
    two are equal. Thus anywhere where we optimise based on alignment we
    should be using alignof(x) not sizeof(x).
    
    This is more annoying than it would be in C11 where we could just use
    _Alignof(x) (and alignof(x) in C++11), but since we still require only
    C99 we must plumb the information all the way from autoconf through the
    various typedefs and defines.
    6f48cece8020
    History
    bpo-43179: Generalise alignment for optimised string routines (GH-24624)
    Jessica Clarke authored
    * Remove m68k-specific hack from ascii_decode
    
    On m68k, alignments of primitives is more relaxed, with 4-byte and
    8-byte types only requiring 2-byte alignment, thus using sizeof(size_t)
    does not work. Instead, use the portable alternative.
    
    Note that this is a minimal fix that only relaxes the assertion and the
    condition for when to use the optimised version remains overly strict.
    Such issues will be fixed tree-wide in the next commit.
    
    NB: In C11 we could use _Alignof(size_t) instead, but for compatibility
    we use autoconf.
    
    * Optimise string routines for architectures with non-natural alignment
    
    C only requires that sizeof(x) is a multiple of alignof(x), not that the
    two are equal. Thus anywhere where we optimise based on alignment we
    should be using alignof(x) not sizeof(x).
    
    This is more annoying than it would be in C11 where we could just use
    _Alignof(x) (and alignof(x) in C++11), but since we still require only
    C99 we must plumb the information all the way from autoconf through the
    various typedefs and defines.