1. 13 9月, 2018 1 次提交
    • R
      move __memalign declaration to malloc_impl.h · b07a5d66
      Rich Felker 提交于
      the malloc-implementation-private header is the only right place for
      this, because, being in the reserved namespace, __memalign is not
      interposable and thus not valid to use anywhere else. anything outside
      of the malloc implementation must call an appropriate-namespace public
      function (aligned_alloc or posix_memalign).
      b07a5d66
  2. 05 7月, 2013 2 次提交
    • R
      move core memalign code from aligned_alloc to __memalign · 6d861ac8
      Rich Felker 提交于
      there are two motivations for this change. one is to avoid
      gratuitously depending on a C11 symbol for implementing a POSIX
      function. the other pertains to the documented semantics. C11 does not
      define any behavior for aligned_alloc when the length argument is not
      a multiple of the alignment argument. posix_memalign on the other hand
      places no requirements on the length argument. using __memalign as the
      implementation of both, rather than trying to implement one in terms
      of the other when their documented contracts differ, eliminates this
      confusion.
      6d861ac8
    • R
      move alignment check from aligned_alloc to posix_memalign · 65141618
      Rich Felker 提交于
      C11 has no requirement that the alignment be a multiple of
      sizeof(void*), and in fact seems to require any "valid alignment
      supported by the implementation" to work. since the alignment of char
      is 1 and thus a valid alignment, an alignment argument of 1 should be
      accepted.
      65141618
  3. 07 12月, 2012 1 次提交
    • R
      fix invalid read in aligned_alloc · 2ad9cf52
      Rich Felker 提交于
      in case of mmap-obtained chunks, end points past the end of the
      mapping and reading it may fault. since the value is not needed until
      after the conditional, move the access to prevent invalid reads.
      2ad9cf52
  4. 26 8月, 2012 1 次提交
    • R
      implement "low hanging fruit" from C11 · 9bff7c13
      Rich Felker 提交于
      based on Gregor's patch sent to the list. includes:
      - stdalign.h
      - removing gets in C11 mode
      - adding aligned_alloc and adjusting other functions to use it
      - adding 'x' flag to fopen for exclusive mode
      9bff7c13
  5. 30 6月, 2011 1 次提交
  6. 12 2月, 2011 1 次提交