summaryrefslogtreecommitdiff
path: root/lib/malloc
Commit message (Collapse)AuthorAgeFilesLines
* dynarray: merge from glibcPaul Eggert2021-08-111-1/+2
| | | | | | | | | | | | | This also helps document glibc’s direction in using GCC’s memory-allocation checking. * lib/cdefs.h: Omit comments that glibc rejected. (__returns_nonnull, __attr_access_none, __attr_dealloc) (__attr_dealloc_free): New macros. * lib/libc-config.h: Undef the new macros that are defined unconditionally. * lib/malloc/dynarray_at_failure.c [_LIBC]: Do not include stdlib.h. (__libc_dynarray_at_failure) [_LIBC]: Call __libc_fatal, fixing a bad merge previously.
* libc-config: port to DragonFlyBSD 5.9Paul Eggert2021-03-101-15/+18
| | | | | | | | | | | | DragonFlyBSD defines __nonnull incompatibly with glibc, so avoid the use of __nonnull in Gnulib code. Problem reported by Gavin Smith in: https://lists.gnu.org/r/bug-gnulib/2021-03/msg00066.html * lib/cdefs.h (__attribute_nonnull__): Rename from __nonnull. All uses in Gnulib changed. There should be no need to change glibc code that is not shared with Gnulib. (__nonnull): New macro, defined in terms of __attribute_nonnull__, and which can be used in glibc code that is not shared with Gnulib.
* Port better to macOS MojavePaul Eggert2021-02-165-0/+20
| | | | | | | | | | | | | | Problem reported by Tom Shields in: https://lists.gnu.org/r/bug-gnulib/2021-02/msg00064.html * config/srclist.txt: Comment out dynarray_finalize.c. * lib/dynarray.h (__libc_dynarray_at_failure): Don’t include libc-config.h here, as that’s the includer’s responsibility. * lib/malloc/dynarray_at_failure.c: * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_finalize.c: * lib/malloc/dynarray_resize.c: * lib/malloc/dynarray_resize_clear.c: If _LIBC is not defined, include libc-config.h.
* dynarray: work even if ‘free’ is replacedPaul Eggert2021-01-081-3/+7
| | | | | | | Problem reported by Darshit Shah in: https://lists.gnu.org/r/bug-gnulib/2021-01/msg00140.html * lib/malloc/dynarray-skeleton.c (DYNARRAY_FREE): New macro. Use it everywhere instead of DYNARRAY_NAME (free).
* dynarray: new modulePaul Eggert2021-01-087-0/+968
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config/srclist.txt: Mention the new files. * lib/cdefs.h (__attribute_maybe_unused__): New macro, like Gnulib’s _GL_ATTRIBUTE_MAYBE_UNUSED but with glibc naming conventions. * lib/libc-config.h: Use it instead of __glibc_likely. * lib/dynarray.h, modules/dynarray: New files. * lib/malloc/dynarray-skeleton.c, lib/malloc/dynarray.h: * lib/malloc/dynarray_at_failure.c: * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_finalize.c, lib/malloc/dynarray_resize.c: * lib/malloc/dynarray_resize_clear.c, modules/dynarray: New files, from glibc with the following changes needed for portability to compilers that are not recent-enough GCC. * lib/malloc/dynarray_at_failure.c: Include stdlib.h, for abort. (__libc_dynarray_at_failure) [!_LIBC]: Simply abort. * lib/malloc/dynarray_emplace_enlarge.c: * lib/malloc/dynarray_resize.c: Include intprops.h, and use INT_MULTIPLY_WRAPV instead of __builtin_mul_overflow. * lib/malloc/dynarray.h (__libc_dynarray_at_failure): Use _Noreturn instead of __attribute__ ((noreturn)). * lib/malloc/dynarray_resize_clear.c: Do not include stdlib.h; it’s not needed. (__libc_dynarray_resize_clear): Do not do arithmetic on void *. * lib/malloc/dynarray-skeleton.c (struct DYNARRAY_STRUCT): Do not use anonymous unions, as they are not in C99. All uses changed. Use __nonnull (X) instead of __attribute__ ((nonnull X)), and __attribute_maybe_unused__ instead of __attribute__ ((unused)).
* autoupdateKarl Berry2021-01-033-3/+3
|
* maint: run 'make update-copyright'Paul Eggert2020-12-312-2/+2
|
* canonicalize: simplify via scratch_buffer_dupfreePaul Eggert2020-12-282-0/+57
| | | | | | | | | | | * config/srclist.txt: Adjust accordingly. * lib/canonicalize-lgpl.c (realpath_stk): * lib/canonicalize.c (canonicalize_filename_mode_stk): Simplify by using scratch_buffer_dupfree. * lib/malloc/scratch_buffer.h (scratch_buffer_dupfree): New function. * lib/malloc/scratch_buffer_dupfree.c: New file. * modules/scratch_buffer (Files, Depends-on): Add malloc/scratch_buffer_dupfree.c.
* autoupdatePaul Eggert2019-12-314-4/+4
|
* scratch_buffer: sync from glibcPaul Eggert2019-09-072-5/+5
| | | | | | * config/srclist.txt: Add the scratch_buffer source code from glibc, since these should be in sync. Autoupdate.
* maint: Run 'make update-copyright'Paul Eggert2019-01-014-4/+4
|
* maint: Run 'make update-copyright'Paul Eggert2018-01-014-4/+4
|
* all: prefer https: URLsPaul Eggert2017-09-134-4/+4
|
* scratch_buffer: don’t use private glibc APIPaul Eggert2017-09-024-0/+322
Suggested by Florian Weimer in: http://lists.gnu.org/archive/html/bug-gnulib/2017-09/msg00004.html * lib/scratch_buffer.h: Rename to lib/malloc/scratch_buffer.h. * lib/scratch_buffer_grow.c: Rename to lib/malloc/scratch_buffer_grow.c. * lib/scratch_buffer_grow_preserve.c: Rename to lib/malloc/scratch_buffer_grow_preserve.c. * lib/scratch_buffer_set_array_size.c: Rename to lib/malloc/scratch_buffer_set_array_size.c. * lib/scratch_buffer.h: New file. * modules/scratch_buffer (Files, Makefile.am): Adjust to source-file renaming.