1. 21 Jun, 2018 1 commit
    • Paul Eggert's avatar
      random, random_r: merge from glibc · 137dda35
      Paul Eggert authored
      * lib/random.c, lib/random_r.c:
      Include libc-config.h if !_LIBC, not config.h unilaterally.
      * lib/random.c:
      Do not include stdint.h or time.h; not needed.
      Include libc-lock.h if _LIBC, and define substitute macros otherwise.
      (unsafe_state): Rename from generator.  All uses changed.
      Use C99-style initializers.
      (__random, __srandom, __initstate, __setstate): Rename from
      non-underscored version, but define it to non-underscored version
      on Gnulib.  Add a lock.
      * lib/random_r.c (__srandom_r, __initstate_r, __setstate_r, __random_r):
      Likewise.
      Do not include <stdint.h>; not needed since stdlib.h defines int32_t.
      (weak_alias, __set_errno) [!_LIBC]: Remove; now done by libc-config.
      (__srandom_r): Use int32_t instead of long int where int32_t will do.
      (__random_r): Use uint32 to fix glibc bug 17343.
      * modules/random, modules/random_r (Depends-on): Add libc-config.
      Depend on stdint only if $HAVE_RANDOM = 0.
      137dda35
  2. 17 Jun, 2018 1 commit
    • Paul Eggert's avatar
      crypto: use byteswap · 0d45ec7c
      Paul Eggert authored
      * lib/md4.c, lib/md5.c, lib/sha1.c, lib/sha256.c, lib/sha512.c:
      * lib/sm3.c: Include <byteswap.h>.
      (SWAP): Use its macros rather than reinventing the wheel.
      * modules/crypto/md4, modules/crypto/md5-buffer:
      * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer:
      * modules/crypto/sha512-buffer, modules/crypto/sm3:
      (Depends-on): Add byteswap.
      0d45ec7c
  3. 04 Jun, 2018 1 commit
  4. 21 May, 2018 2 commits
    • Paul Eggert's avatar
      crypto: omit stream ops Emacs doesn’t need · 0c011767
      Paul Eggert authored
      * lib/md5.c (md5_stream):
      * lib/sha1.c (sha1_stream):
      * lib/sha256.c (shaxxx_stream, sha256_stream, sha224_stream):
      * lib/sha512.c (shaxxx_stream, sha512_stream, sha384_stream):
      Compile stream functions only if GL_COMPILE_CRYPTO_STREAM is
      defined.  Emacs needs this, as it does not use the stream
      operations and doesn’t need all the af_alg stuff we’ve recently
      added.  Perhaps a similar change is needed to the other crypto
      modules, but this patch changes only those needed for Emacs.
      * modules/crypto/md5-buffer, modules/crypto/sha1-buffer:
      * modules/crypto/sha256-buffer, modules/crypto/sha512-buffer:
      New modules, used by Emacs.
      * modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
      * modules/crypto/sha512: Rewrite to depend on the new modules.
      0c011767
    • Bruno Haible's avatar
      wcwidth tests: Fix link error. · 1193175e
      Bruno Haible authored
      * modules/wcwidth-tests (Makefile.am): Link test-wcwidth against
      $(LIBUNISTRING).
      1193175e
  5. 20 May, 2018 2 commits
    • Bruno Haible's avatar
      regex: Fix "error: possibly undefined macro: gl_GLIBC21". · 68d64349
      Bruno Haible authored
      * modules/regex (Files): Add m4/glibc21.m4.
      68d64349
    • Bruno Haible's avatar
      localcharset: Move mapping tables into the code. · bb5cc1c5
      Bruno Haible authored
      * lib/localcharset.h: Document the GNU canonical names for character
      encodings here.
      * lib/localcharset.c: Don't include <fcntl.h>, <unistd.h>,
      relocatable.h, configmake.h.
      (O_NOFOLLOW, ISSLASH, DIRECTORY_SEPARATOR, getc, volatile): Remove
      macros.
      (charset_aliases): Remove variable.
      (get_charset_aliases): Remove function.
      (struct table_entry): New type.
      (alias_table, locale_table): New constants.
      (locale_charset): Use the alias_table or locale_table to get the
      canonicalized encoding name.
      * lib/config.charset: Remove file.
      * lib/ref-add.sin: Remove file.
      * lib/ref-del.sin: Remove file.
      * m4/localcharset.m4 (gl_LOCALCHARSET): Don't require gl_FCNTL_O_FLAGS,
      AC_CANONICAL_HOST, gl_GLIBC21. Don't check for getc_unlocked.
      * modules/localcharset (Notice): Remove.
      (Files): Remove config.charset, ref-add.sin, ref-del.sin, fcntl-o.m4,
      glibc21.m4.
      (Depends-on): Remove configmake.
      (configure.ac): Define LOCALCHARSET_TESTS_ENVIRONMENT to empty.
      (Makefile.am): Simplify.
      * build-aux/prefix-gnulib-mk: Remove special code for the removed files.
      bb5cc1c5
  6. 19 May, 2018 1 commit
  7. 13 May, 2018 4 commits
    • Bruno Haible's avatar
      truncate: Fix compilation error on Android. · a0f15cb0
      Bruno Haible authored
      * m4/truncate.m4 (gl_FUNC_TRUNCATE): Test also whether 'truncate' is
      declared. Set HAVE_DECL_TRUNCATE, not HAVE_TRUNCATE.
      * lib/unistd.in.h (truncate): Test HAVE_DECL_TRUNCATE, not
      HAVE_TRUNCATE.
      * modules/truncate: Likewise.
      * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize HAVE_DECL_TRUNCATE,
      not HAVE_TRUNCATE.
      * modules/unistd (Makefile.am): Substitute HAVE_DECL_TRUNCATE, not
      HAVE_TRUNCATE.
      * doc/posix-functions/truncate.texi: Mention the issue.
      a0f15cb0
    • Bruno Haible's avatar
      tsearch: Fix compilation error on Android. · b2399209
      Bruno Haible authored
      * lib/search.in.h (twalk): Declare when HAVE_TWALK, not HAVE_TSEARCH,
      is 0.
      (GNULIB_defined_tsearch, GNULIB_defined_twalk): New macros.
      * lib/tsearch.c (tsearch, tfind, tdelete): Define only if
      GNULIB_defined_tsearch is true.
      (twalk): Define only if GNULIB_defined_twalk is true.
      * modules/tsearch (configure.ac): Compile tsearch.c also if HAVE_TWALK
      is 0.
      * m4/tsearch.m4 (gl_FUNC_TSEARCH): Set HAVE_TWALK.
      * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize HAVE_TWALK.
      * modules/search (Makefile.am): Substitute HAVE_TWALK.
      b2399209
    • Bruno Haible's avatar
      imaxdiv: Fix compilation error on Android. · 88d119b2
      Bruno Haible authored
      * m4/imaxdiv.m4 (gl_FUNC_IMAXDIV): Set HAVE_IMAXDIV_T to 0 if imaxdiv_t
      is not defined.
      * lib/inttypes.in.h (imaxdiv_t): Define if HAVE_IMAXDIV_T, not
      HAVE_DECL_IMAXDIV, is 0.
      * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Initialize HAVE_IMAXDIV_T.
      * modules/inttypes-incomplete (Makefile.am): Substitute HAVE_IMAXDIV_T.
      88d119b2
    • Bruno Haible's avatar
      getpagesize: Fix compilation error on Android. · 0cc03459
      Bruno Haible authored
      * m4/getpagesize.m4 (gl_CHECK_FUNC_GETPAGESIZE): New macro.
      (gl_FUNC_GETPAGESIZE): Invoke it instead of AC_CHECK_FUNC.
      * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Don't invoke
      AC_CHECK_FUNC. Instead, invoke gl_CHECK_FUNC_GETPAGESIZE and define
      HAVE_GETPAGESIZE accordingly.
      * modules/getcwd (Files): Add m4/getpagesize.m4.
      0cc03459
  8. 10 May, 2018 1 commit
    • Paul Eggert's avatar
      af_alg: recover better from crypto failures · cb17397c
      Paul Eggert authored
      * lib/af_alg.c (afalg_stream): Recover from crypto failures if the
      input stream is seekable, by repositioning the stream back to
      where it was, possibly by just calling sendfile with an offset
      arg.  This lets us return -EAFNOSUPPORT instead of -EIO in some
      cases, which lets our callers try again with user-mode code.
      * modules/crypto/af_alg (Depends-on): Depend on fseeko and ftello
      instead of on fflush and lseek.
      cb17397c
  9. 06 May, 2018 3 commits
    • Bruno Haible's avatar
      crypto/{md5,sha1,sha256,sha512} tests: Add benchmarks. · 207cac7a
      Bruno Haible authored
      * tests/bench-digest.h: New file.
      * tests/bench-md5.c: New file.
      * tests/bench-sha1.c: New file.
      * tests/bench-sha224.c: New file.
      * tests/bench-sha256.c: New file.
      * tests/bench-sha384.c: New file.
      * tests/bench-sha512.c: New file.
      * modules/crypto/md5-tests (Files): Add tests/bench-md5.c,
      tests/bench-digest.h.
      (Depends-on): Add getrusage, gettimeofday.
      (Makefile.am): Add variables to build bench-md5.
      * modules/crypto/sha1-tests (Files): Add tests/bench-sha1.c,
      tests/bench-digest.h.
      (Depends-on): Add getrusage, gettimeofday.
      (Makefile.am): Add variables to build bench-sha1.
      * modules/crypto/sha256-tests (Files): Add tests/bench-sha224.c,
      tests/bench-sha256.c, tests/bench-digest.h.
      (Depends-on): Add getrusage, gettimeofday.
      (Makefile.am): Add variables to build bench-sha224, bench-sha256.
      * modules/crypto/sha512-tests (Files): Add tests/bench-sha384.c,
      tests/bench-sha512.c, tests/bench-digest.h.
      (Depends-on): Add getrusage, gettimeofday.
      (Makefile.am): Add variables to build bench-sha384, bench-sha512.
      207cac7a
    • Bruno Haible's avatar
      af_alg: Fix bug with streams that are not at position 0. · 22d459bb
      Bruno Haible authored
      * lib/af_alg.c (afalg_stream): Before sendfile, invoke fflush. Don't
      assume that the stream is positioned at position 0.
      * lib/af_alg.h (afalg_stream): Mention restriction regarding the state
      of the stream.
      * lib/md5.h (md5_stream): Likewise.
      * lib/sha1.h (sha1_stream): Likewise.
      * lib/sha256.h (sha256_stream, sha224_stream): Likewise.
      * lib/sha512.h (sha512_stream, sha384_stream): Likewise.
      * modules/crypto/af_alg (Depends-on): Add fflush, lseek.
      22d459bb
    • Bruno Haible's avatar
      Followup to 'af_alg: New module.'. · 55832dcf
      Bruno Haible authored
      * modules/crypto/md5 (Depends-on): Remove sys_socket, sys_stat.
      * modules/crypto/sha1 (Depends-on): Likewise.
      * modules/crypto/sha256 (Depends-on): Likewise.
      * modules/crypto/sha512 (Depends-on): Likewise.
      55832dcf
  10. 05 May, 2018 12 commits
    • Bruno Haible's avatar
      af_alg: New module. · 459221a8
      Bruno Haible authored
      * lib/af_alg.h: Test HAVE_* macro through '#if', not '#ifdef'.
      * lib/af_alg.c: Include "af_alg.h" before the other header files.
      * lib/md5.c: Include "af_alg.h" unconditionally.
      (md5_stream): Invoke afalg_stream unconditionally.
      * lib/sha1.c: Include "af_alg.h" unconditionally.
      (sha1_stream): Invoke afalg_stream unconditionally.
      * lib/sha256.c: Include "af_alg.h" unconditionally.
      (sha256_stream, sha224_stream): Invoke afalg_stream unconditionally.
      * lib/sha512.c: Include "af_alg.h" unconditionally.
      (sha512_stream, sha384_stream): Invoke afalg_stream unconditionally.
      * m4/af_alg.m4: Renamed from m4/linux-if-alg.m4.
      (gl_AF_ALG): Renamed from gl_LINUX_IF_ALG_H.
      * modules/crypto/af_alg: New file.
      * modules/crypto/md5 (Files): Remove files that are now in the
      'crypto/af_alg' module.
      (Depends-on): Add crypto/af_alg.
      (configure.ac): Remove gl_LINUX_IF_ALG_H invocation.
      (Makefile.am): Don't mention af_alg.c here.
      * modules/crypto/sha1 (Files): Remove files that are now in the
      'crypto/af_alg' module.
      (Depends-on): Add crypto/af_alg.
      (configure.ac): Remove gl_LINUX_IF_ALG_H invocation.
      (Makefile.am): Don't mention af_alg.c here.
      * modules/crypto/sha256 (Files): Remove files that are now in the
      'crypto/af_alg' module.
      (Depends-on): Add crypto/af_alg.
      (configure.ac): Remove gl_LINUX_IF_ALG_H invocation.
      (Makefile.am): Don't mention af_alg.c here.
      * modules/crypto/sha512 (Files): Remove files that are now in the
      'crypto/af_alg' module.
      (Depends-on): Add crypto/af_alg.
      (configure.ac): Remove gl_LINUX_IF_ALG_H invocation.
      (Makefile.am): Don't mention af_alg.c here.
      459221a8
    • Paul Eggert's avatar
      sys-limits.h: new file for crypto and safe I/O · a4fd2b6f
      Paul Eggert authored
      * lib/af_alg.c: Include sys-limits.h.
      (MAX_RW_COUNT): Remove.  Use replaced by SYS_BUFSIZE_MAX.
      (afalg_stream): Also reject negative sizes for sendfile; they
      should not happen and the code is a bit cleaner and faster this way.
      * lib/safe-read.c: Include sys-limits.h.
      (BUGGY_READ_MAXIMUM): Remove.  All uses replaced by SYS_BUFSIZE_MAX.
      * lib/sys-limits.h: New file, with values and commentary derived
      from the old safe-read.c and from GNU Emacs sysdep.c.
      * modules/crypto/md5, modules/crypto/sha1, modules/crypto/sha256:
      * modules/crypto/sha512, modules/safe-read, modules/safe-write:
      Add lib/sys-limits.h to Files section.
      a4fd2b6f
    • Bruno Haible's avatar
      crypto/{md5,sha1,sha256,sha512}: Fix compilation error (S_TYPEISTMO). · ba0ffea0
      Bruno Haible authored
      * modules/crypto/md5 (Depends-on): Add 'sys_stat'.
      * modules/crypto/sha1 (Depends-on): Likewise.
      * modules/crypto/sha256 (Depends-on): Likewise.
      * modules/crypto/sha512 (Depends-on): Likewise.
      ba0ffea0
    • Bruno Haible's avatar
      crypto/{md5,sha1,sha256,sha512}: Fix module description. · dad2461a
      Bruno Haible authored
      * modules/crypto/md5 (Depends-on): Add 'sys_socket'.
      * modules/crypto/sha1 (Depends-on): Likewise.
      * modules/crypto/sha256 (Depends-on): Likewise.
      * modules/crypto/sha512 (Depends-on): Likewise.
      dad2461a
    • Bruno Haible's avatar
      sha512: Add tests. · 6c3f5ab2
      Bruno Haible authored
      * tests/test-sha512.c: New file.
      * modules/crypto/sha512-tests: New file.
      6c3f5ab2
    • Bruno Haible's avatar
      sha256: Add tests. · a4be0318
      Bruno Haible authored
      * tests/test-sha256.c: New file.
      * modules/crypto/sha256-tests: New file.
      a4be0318
    • Bruno Haible's avatar
      sha1 tests: Add test for sha1_stream. · 854681bd
      Bruno Haible authored
      * tests/test-sha1.c: Include test-digest.h.
      (main): Invoke test_digest_on_files on 'sha1_stream'.
      * modules/crypto/sha1-tests (Files): Add tests/test-digest.h.
      854681bd
    • Bruno Haible's avatar
      md5 tests: Add test for md5_stream. · a0bdcae5
      Bruno Haible authored
      * tests/test-digest.h: New file.
      * tests/test-md5.c: Include test-digest.h.
      (main): Invoke test_digest_on_files on 'md5_stream'.
      * modules/crypto/md5-tests (Files): Add tests/test-digest.h.
      a0bdcae5
    • Matteo Croce's avatar
      md5sum: use kernel crypto API · a720fab2
      Matteo Croce authored
      Use AF_ALG for md5 too
      Signed-off-by: 's avatarMatteo Croce <mcroce@redhat.com>
      a720fab2
    • Matteo Croce's avatar
      sha512sum: use kernel crypto API · 833bb2f5
      Matteo Croce authored
      Use AF_ALG for sha384 and sha512 too
      Signed-off-by: 's avatarMatteo Croce <mcroce@redhat.com>
      833bb2f5
    • Matteo Croce's avatar
      sha256sum: use kernel crypto API · cb08dad2
      Matteo Croce authored
      Use AF_ALG for sha224 and sha256 too
      Signed-off-by: 's avatarMatteo Croce <mcroce@redhat.com>
      cb08dad2
    • Matteo Croce's avatar
      sha1sum: use AF_ALG when available · 7074a586
      Matteo Croce authored
      Linux supports accessing kernel crypto API via AF_ALG since
      version 2.6.38. Coreutils uses libcrypto when available and fallbacks to
      generic C implementation of various hashing functions.
      
      Add a generic afalg_stream() function which uses AF_ALG to calculate the
      hash of a stream and use sendfile() when possible (regular file with size
      less or equal than 0x7ffff000 (2,147,479,552) bytes, AKA MAX_RW_COUNT).
      
      Use afalg_stream() only in sha1sum for now, but other hashes are possible.
      The speed gain really depends on the CPU type, on systems which doesn't use
      libcrypto ranges from ~10% to 320%.
      
      This is a test on a Intel(R) Xeon(R) CPU E3-1265L V2 and Debian stretch:
      
          $ truncate -s 2GB 2g.bin
          $ time sha1sum 2g.bin
          752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
      
          real    0m4.829s
          user    0m4.437s
          sys     0m0.391s
          $ time ./sha1sum-afalg 2g.bin
          752ef2367f479e79e4f0cded9c270c2890506ab0  2g.bin
      
          real    0m3.164s
          user    0m0.000s
          sys     0m3.162s
      Signed-off-by: 's avatarMatteo Croce <mcroce@redhat.com>
      7074a586
  11. 24 Apr, 2018 1 commit
    • Bruno Haible's avatar
      sys_socket: Make SO_REUSEPORT available across platforms. · 37efd1c5
      Bruno Haible authored
      Reported by Tom G. Christensen <tgc@jupiterrise.com>.
      
      * lib/sys_socket.in.h (SO_REUSEPORT): New macro.
      * doc/posix-headers/sys_socket.texi: Mention the issue.
      * tests/test-poll.c (SO_REUSEPORT): Remove.
      * tests/test-select.h: Include <sys/socket.h>.
      (SO_REUSEPORT): Remove.
      * modules/select-tests (Depends-on): Add 'sys_socket'.
      37efd1c5
  12. 07 Apr, 2018 1 commit
    • Bruno Haible's avatar
      unicase/u*-context: Fix link errors with libunistring <= 0.9.9. · 8f9b7b4f
      Bruno Haible authored
      Reported by Genki Sky <sky@genki.is>.
      
      * modules/unicase/u8-prefix-context (configure.ac): Require libunistring
      version 0.9.10 or newer.
      * modules/unicase/u8-suffix-context (configure.ac): Likewise.
      * modules/unicase/u16-prefix-context (configure.ac): Likewise.
      * modules/unicase/u16-suffix-context (configure.ac): Likewise.
      * modules/unicase/u32-prefix-context (configure.ac): Likewise.
      8f9b7b4f
  13. 24 Mar, 2018 1 commit
  14. 16 Mar, 2018 2 commits
    • Bruno Haible's avatar
      glob: Don't compile replacements on recent glibc systems. · a96f69a5
      Bruno Haible authored
      * lib/glob.in.h: Use the usual idiom for the double-inclusion guard. If
      REPLACE_GLOB is 0, include the system's <glob.h> and use
      _GL_CXXALIAS_SYS.
      * m4/glob.m4 (gl_GLOB): Set REPLACE_GLOB instead of GLOB_H. Accept
      _GNU_GLOB_INTERFACE_VERSION 2 as well. Delete the file conf$$-globtest
      inside the AC_RUN_IFELSE block. Remove GL_GENERATE_GLOB_H conditional.
      * modules/glob (Dependencies): Test REPLACE_GLOB instead of GLOB_H.
      Remove snippet/warn-on-use.
      (configure.ac): Test REPLACE_GLOB instead of GLOB_H.
      (Makefile.am): Create glob.h always. Update list of substitutions in
      glob.h. Don't depend on $(WARN_ON_USE_H).
      a96f69a5
    • Bruno Haible's avatar
      glob: Fix link error on native Windows. · e9866b99
      Bruno Haible authored
      * modules/glob (Depends-on): Add 'lstat'.
      e9866b99
  15. 24 Feb, 2018 1 commit
    • Bruno Haible's avatar
      striconveha, uniconv/*: Avoid test failures on musl libc. · 4ce79717
      Bruno Haible authored
      * tests/iconvsupport.c: New file.
      * tests/test-striconveha.c (main): Skip autodetect_jp tests if iconv()
      does not support the ISO-2022-JP-2 encoding.
      * tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
      * tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
      * tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
      * tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
      * tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
      * tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
      * modules/striconveha-tests (Files): Add tests/iconvsupport.c.
      (Makefile.am): Link test-striconveha with iconvsupport.o.
      * modules/uniconv/u8-conv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u8-conv-from-enc with iconvsupport.o.
      * modules/uniconv/u8-strconv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u8-strconv-from-enc with iconvsupport.o.
      * modules/uniconv/u16-conv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u16-conv-from-enc with iconvsupport.o.
      * modules/uniconv/u16-strconv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u16-strconv-from-enc with iconvsupport.o.
      * modules/uniconv/u32-conv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u32-conv-from-enc with iconvsupport.o.
      * modules/uniconv/u32-strconv-from-enc-tests (Files): Add
      tests/iconvsupport.c.
      (Makefile.am): Link test-u32-strconv-from-enc with iconvsupport.o.
      4ce79717
  16. 20 Feb, 2018 2 commits
    • Paul Eggert's avatar
      utimecmp: new function utimecmpat · a4d64c00
      Paul Eggert authored
      * lib/utimecmp.c: Include fcntl.h, sys/stat.h and dirname.h.
      Do not include utimens.h.
      (utimecmpat): New function, generalizing utimecmp.
      (utimecmp): Now a thin layer around utimecmpat.
      * modules/utimecmp (Depends-on): Depend on dirname-lgpl, fstatat,
      utimensat instead of on lstat and utimens.
      a4d64c00
    • Paul Eggert's avatar
      same: new function same_nameat · d50980dd
      Paul Eggert authored
      * lib/same.c: Include fcntl.h.
      * lib/same.c (same_nameat): New function, generalizing same_name.
      (same_name): Now a thin layer around same_nameat.
      * m4/same.m4 (gl_SAME): Check for fpathconf, not pathconf.
      * modules/same (Depends-on): Depend on fstatat, openat.
      d50980dd
  17. 17 Feb, 2018 1 commit
    • Bruno Haible's avatar
      lock: Add test of gl_once. · a798733d
      Bruno Haible authored
      * tests/test-once.c: New file.
      * modules/lock-tests (Files): Add it.
      (Makefile.am): Build and test programs 'test-once1' and 'test-once2'.
      a798733d
  18. 04 Feb, 2018 1 commit
  19. 02 Feb, 2018 2 commits
    • Paul Eggert's avatar
      malloca: Add a compile-time verification. · d6a3b8f0
      Paul Eggert authored
      * lib/malloca.c (small_t): Verify that it is wide enough.
      * modules/malloca (Depends-on): Add verify.
      d6a3b8f0
    • Bruno Haible's avatar
      malloca, xmalloca: Make multithread-safe. · 8a4aa2ec
      Bruno Haible authored
      Reported by Florian Weimer <fweimer@redhat.com>.
      Implements an idea by Ondřej Bílka <neleai@seznam.cz>.
      
      * lib/malloca.h (malloca): In the stack allocation case, return a
      pointer that is a multiple of 2 * sa_alignment_max.
      (sa_increment): Remove enum item.
      * lib/xmalloca.h (xmalloca): In the stack allocation case, return
      a pointer that is a multiple of 2 * sa_alignment_max.
      * lib/malloca.c (NO_SANITIZE_MEMORY): Remove macro.
      (MAGIC_NUMBER, MAGIC_SIZE, preliminary_header, HEADER_SIZE, header,
      HASH_TABLE_SIZE, mmalloca_results): Remove.
      (small_t): New type.
      (mmalloca, free): Rewritten.
      * lib/malloca.valgrind: Remove file.
      * modules/malloca (Files): Remove it.
      (Depends-on): Remove verify.
      8a4aa2ec