summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>2017-03-17 17:00:38 +0000
committerderaadt <>2017-03-17 17:00:38 +0000
commit6ee5556003da806b1ae4bd259575fd70982e30ba (patch)
tree4c7ed62ec184581a7c650059f45d72b7e7eb1460 /src/lib
parent854a4a0e4ddf686eb6d9e36d8b0af8926c723a28 (diff)
downloadopenbsd-6ee5556003da806b1ae4bd259575fd70982e30ba.tar.gz
openbsd-6ee5556003da806b1ae4bd259575fd70982e30ba.tar.bz2
openbsd-6ee5556003da806b1ae4bd259575fd70982e30ba.zip
Strengthen description of recallocarray(3) behaviour, hoping that readers
make the behaviour -> use case connection. help from jmc and jsing
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/malloc.315
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3
index e24a811bec..0053748991 100644
--- a/src/lib/libc/stdlib/malloc.3
+++ b/src/lib/libc/stdlib/malloc.3
@@ -30,9 +30,9 @@
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" $OpenBSD: malloc.3,v 1.103 2017/03/07 06:07:50 otto Exp $ 33.\" $OpenBSD: malloc.3,v 1.104 2017/03/17 17:00:38 deraadt Exp $
34.\" 34.\"
35.Dd $Mdocdate: March 7 2017 $ 35.Dd $Mdocdate: March 17 2017 $
36.Dt MALLOC 3 36.Dt MALLOC 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
@@ -119,9 +119,14 @@ The
119.Fn recallocarray 119.Fn recallocarray
120function is similar to 120function is similar to
121.Fn reallocarray 121.Fn reallocarray
122except that it takes care of clearing newly allocated memory. 122except it ensures newly allocated memory is cleared similar to
123Additionally, the memory that becomes unallocated while shrinking 123.Xr calloc 3 .
124or moving existing allocations is erased. 124Memory that becomes unallocated while shrinking or moving existing
125allocations is explicitly discarded (meaning, pages of memory
126are disposed via
127.Xr munmap 2 ,
128and smaller allocations are cleared with
129.Xr explicit_bzero 3 Ns ).
125If 130If
126.Fa ptr 131.Fa ptr
127is a 132is a