Mercurial > gnulib
view 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 |
line wrap: on
line source
Description: Safe automatic memory allocation. Files: lib/malloca.h lib/malloca.c m4/malloca.m4 m4/eealloc.m4 m4/longlong.m4 Depends-on: alloca-opt stdint xalloc-oversized configure.ac: gl_MALLOCA Makefile.am: lib_SOURCES += malloca.c Include: "malloca.h" License: LGPLv2+ Maintainer: all