aboutsummaryrefslogtreecommitdiffstats
path: root/lib/malloc
diff options
context:
space:
mode:
authorPaul Eggert2021-01-01 01:51:18 -0800
committerPaul Eggert2021-01-01 01:52:03 -0800
commit1b59478f4cf442f5201500b0a9c66f4332fce640 (patch)
tree02787d99a0476a28836390ee9e2ff332445381a1 /lib/malloc
parent50f3949119cd5bb2f058b90d14b2940a3a8a7a0e (diff)
downloademacs-1b59478f4cf442f5201500b0a9c66f4332fce640.tar.gz
emacs-1b59478f4cf442f5201500b0a9c66f4332fce640.zip
Update from Gnulib by running admin/merge-gnulib.
Diffstat (limited to 'lib/malloc')
-rw-r--r--lib/malloc/scratch_buffer.h16
-rw-r--r--lib/malloc/scratch_buffer_grow.c2
-rw-r--r--lib/malloc/scratch_buffer_grow_preserve.c2
-rw-r--r--lib/malloc/scratch_buffer_set_array_size.c2
4 files changed, 19 insertions, 3 deletions
diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h
index 6efca9ba3f4..26e306212d1 100644
--- a/lib/malloc/scratch_buffer.h
+++ b/lib/malloc/scratch_buffer.h
@@ -132,4 +132,20 @@ scratch_buffer_set_array_size (struct scratch_buffer *buffer,
132 (buffer, nelem, size)); 132 (buffer, nelem, size));
133} 133}
134 134
135/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
136 deallocating *BUFFER if it was heap-allocated. SIZE must be at
137 most *BUFFER's size. Return NULL (setting errno) on memory
138 exhaustion. */
139void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
140 size_t size);
141libc_hidden_proto (__libc_scratch_buffer_dupfree)
142
143/* Alias for __libc_scratch_dupfree. */
144static __always_inline void *
145scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
146{
147 void *r = __libc_scratch_buffer_dupfree (buffer, size);
148 return __glibc_likely (r != NULL) ? r : NULL;
149}
150
135#endif /* _SCRATCH_BUFFER_H */ 151#endif /* _SCRATCH_BUFFER_H */
diff --git a/lib/malloc/scratch_buffer_grow.c b/lib/malloc/scratch_buffer_grow.c
index e7606d81cd7..41befe3d65f 100644
--- a/lib/malloc/scratch_buffer_grow.c
+++ b/lib/malloc/scratch_buffer_grow.c
@@ -1,5 +1,5 @@
1/* Variable-sized buffer with on-stack default allocation. 1/* Variable-sized buffer with on-stack default allocation.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc. 2 Copyright (C) 2015-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
4 4
5 The GNU C Library is free software; you can redistribute it and/or 5 The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/malloc/scratch_buffer_grow_preserve.c b/lib/malloc/scratch_buffer_grow_preserve.c
index 59f8c710001..aef232938d5 100644
--- a/lib/malloc/scratch_buffer_grow_preserve.c
+++ b/lib/malloc/scratch_buffer_grow_preserve.c
@@ -1,5 +1,5 @@
1/* Variable-sized buffer with on-stack default allocation. 1/* Variable-sized buffer with on-stack default allocation.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc. 2 Copyright (C) 2015-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
4 4
5 The GNU C Library is free software; you can redistribute it and/or 5 The GNU C Library is free software; you can redistribute it and/or
diff --git a/lib/malloc/scratch_buffer_set_array_size.c b/lib/malloc/scratch_buffer_set_array_size.c
index e2b9f31211a..5f5e4c24f5a 100644
--- a/lib/malloc/scratch_buffer_set_array_size.c
+++ b/lib/malloc/scratch_buffer_set_array_size.c
@@ -1,5 +1,5 @@
1/* Variable-sized buffer with on-stack default allocation. 1/* Variable-sized buffer with on-stack default allocation.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc. 2 Copyright (C) 2015-2020 Free Software Foundation, Inc.
3 This file is part of the GNU C Library. 3 This file is part of the GNU C Library.
4 4
5 The GNU C Library is free software; you can redistribute it and/or 5 The GNU C Library is free software; you can redistribute it and/or