]> Savannah Git Hosting - gnulib.git/commit
malloca, xmalloca: Make multithread-safe.
authorBruno Haible <bruno@clisp.org>
Fri, 2 Feb 2018 18:32:02 +0000 (19:32 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 2 Feb 2018 18:32:02 +0000 (19:32 +0100)
commit8a4aa2ec86c0e94c6ed548519b1660c6b1bac0c1
tree82db5e78ebd3a58a720ca0759b31d0a3edbf2c55
parentcf56f8f618c48cfadd2499ced58574633d12f129
malloca, xmalloca: Make multithread-safe.

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.
ChangeLog
lib/malloca.c
lib/malloca.h
lib/malloca.valgrind [deleted file]
lib/xmalloca.h
modules/malloca