summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorotto <>2017-04-23 06:36:36 +0000
committerotto <>2017-04-23 06:36:36 +0000
commit201c97ba560e6c59a7dbb7d3743d0d08abb2b545 (patch)
treee961aa3a0ba427813e9665c83ce92a1ac0ebe6cc
parentc55942aa2765a47b52e4dc8d26949e26d41a99bb (diff)
downloadopenbsd-201c97ba560e6c59a7dbb7d3743d0d08abb2b545.tar.gz
openbsd-201c97ba560e6c59a7dbb7d3743d0d08abb2b545.tar.bz2
openbsd-201c97ba560e6c59a7dbb7d3743d0d08abb2b545.zip
Rearrange text a bit to make it clear what "discarded" means; ok jmc@ deraadt@
-rw-r--r--src/lib/libc/stdlib/malloc.321
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3
index a943d1baf5..526fa099d2 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.113 2017/04/17 18:07:15 otto Exp $ 33.\" $OpenBSD: malloc.3,v 1.114 2017/04/23 06:36:36 otto Exp $
34.\" 34.\"
35.Dd $Mdocdate: April 17 2017 $ 35.Dd $Mdocdate: April 23 2017 $
36.Dt MALLOC 3 36.Dt MALLOC 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
@@ -155,16 +155,21 @@ and checks for integer overflow in the calculation
155Used for the allocation of memory holding sensitive data, 155Used for the allocation of memory holding sensitive data,
156the 156the
157.Fn recallocarray 157.Fn recallocarray
158and
159.Fn freezeo
160functions guarantee that memory becoming unallocated is explicitly
161.Em discarded ,
162meaning pages of memory are disposed via
163.Xr munmap 2
164and cached free objects are cleared with
165.Xr explicit_bzero 3 .
166.Pp
167The
168.Fn recallocarray
158function is similar to 169function is similar to
159.Fn reallocarray 170.Fn reallocarray
160except it ensures newly allocated memory is cleared similar to 171except it ensures newly allocated memory is cleared similar to
161.Fn calloc . 172.Fn calloc .
162Memory that becomes unallocated while shrinking or moving existing
163allocations is explicitly discarded (meaning, pages of memory
164are disposed via
165.Xr munmap 2 ,
166and smaller allocations are cleared with
167.Xr explicit_bzero 3 ) .
168If 173If
169.Fa ptr 174.Fa ptr
170is 175is