From a900e641fa1fd765799f12a7f699f768ebfccfe8 Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Fri, 22 Jan 2021 11:45:38 -0800
Subject: Update from Gnulib by running admin/merge-gnulib
---
lib/malloc/dynarray_resize_clear.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
create mode 100644 lib/malloc/dynarray_resize_clear.c
(limited to 'lib/malloc/dynarray_resize_clear.c')
diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c
new file mode 100644
index 00000000000..99c2cc87c31
--- /dev/null
+++ b/lib/malloc/dynarray_resize_clear.c
@@ -0,0 +1,35 @@
+/* Increase the size of a dynamic array and clear the new part.
+ Copyright (C) 2017-2021 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with the GNU C Library; if not, see
+ . */
+
+#include
+#include
+
+bool
+__libc_dynarray_resize_clear (struct dynarray_header *list, size_t size,
+ void *scratch, size_t element_size)
+{
+ size_t old_size = list->used;
+ if (!__libc_dynarray_resize (list, size, scratch, element_size))
+ return false;
+ /* __libc_dynarray_resize already checked for overflow. */
+ char *array = list->array;
+ memset (array + (old_size * element_size), 0,
+ (size - old_size) * element_size);
+ return true;
+}
+libc_hidden_def (__libc_dynarray_resize_clear)
--
cgit v1.2.1
From 68a256c89270ef9e97bca6097967a9ed2b050f4a Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Mon, 4 Oct 2021 12:11:39 -0700
Subject: Update from Gnulib
Make the following changes by hand, and run 'admin/merge-gnulib'.
* .gitignore: Add lib/malloc/*.gl.h.
* admin/merge-gnulib: Copy lib/af_alg.h and lib/save-cwd.h
directly from Gnulib, without worrying about Gnulib modules,
as these files are special cases.
(AVOIDED_MODULES): Remove malloc-posix.
* lib/malloc.c, lib/realloc.c, m4/malloc.m4, m4/realloc.m4:
* m4/year2038.m4: New files, copied from Gnulib.
* lib/malloca.c, lib/malloca.h:
* m4/close-stream.m4, m4/glibc21.m4, m4/malloca.m4:
Remove. These are either no longer present in Gnulib, or are no
longer needed by modules that Emacs uses.
* oldXMenu/AddPane.c, oldXmenu/Addsel.c: Include XmenuInt.h first;
needed for new Gnulib.
* src/xmenu.c: Call emacs_abort, not abort.
---
lib/malloc/dynarray_resize_clear.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
(limited to 'lib/malloc/dynarray_resize_clear.c')
diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c
index 99c2cc87c31..9c43b00c3a7 100644
--- a/lib/malloc/dynarray_resize_clear.c
+++ b/lib/malloc/dynarray_resize_clear.c
@@ -3,19 +3,23 @@
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public
+ modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
- version 3 of the License, or (at your option) any later version.
+ version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ Lesser General Public License for more details.
- You should have received a copy of the GNU General Public
+ You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
. */
+#ifndef _LIBC
+# include
+#endif
+
#include
#include
--
cgit v1.2.1
From 19dcb237b5b02b36580294ab309124f346a66024 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii
Date: Sat, 1 Jan 2022 02:45:51 -0500
Subject: ; Add 2022 to copyright years.
---
lib/malloc/dynarray_resize_clear.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib/malloc/dynarray_resize_clear.c')
diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c
index 9c43b00c3a7..8cf1b0d0268 100644
--- a/lib/malloc/dynarray_resize_clear.c
+++ b/lib/malloc/dynarray_resize_clear.c
@@ -1,5 +1,5 @@
/* Increase the size of a dynamic array and clear the new part.
- Copyright (C) 2017-2021 Free Software Foundation, Inc.
+ Copyright (C) 2017-2022 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
--
cgit v1.2.1