Mercurial > gnulib
comparison modules/malloca @ 39235:6a04b04905e5
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.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 02 Feb 2018 19:32:02 +0100 |
parents | ab7a57bd5e3b |
children | aed3915d414d |
comparison
equal
deleted
inserted
replaced
39234:c153a5913479 | 39235:6a04b04905e5 |
---|---|
2 Safe automatic memory allocation. | 2 Safe automatic memory allocation. |
3 | 3 |
4 Files: | 4 Files: |
5 lib/malloca.h | 5 lib/malloca.h |
6 lib/malloca.c | 6 lib/malloca.c |
7 lib/malloca.valgrind | |
8 m4/malloca.m4 | 7 m4/malloca.m4 |
9 m4/eealloc.m4 | 8 m4/eealloc.m4 |
10 m4/longlong.m4 | 9 m4/longlong.m4 |
11 | 10 |
12 Depends-on: | 11 Depends-on: |
13 alloca-opt | 12 alloca-opt |
14 stdint | 13 stdint |
15 xalloc-oversized | 14 xalloc-oversized |
16 verify | |
17 | 15 |
18 configure.ac: | 16 configure.ac: |
19 gl_MALLOCA | 17 gl_MALLOCA |
20 | 18 |
21 Makefile.am: | 19 Makefile.am: |