summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib
diff options
context:
space:
mode:
authorschwarze <>2025-05-24 12:47:11 +0000
committerschwarze <>2025-05-24 12:47:11 +0000
commit28466dd8a1227d2d5931b7fc1510d78bd68967e8 (patch)
treedb56ac398277276ffa4c0507d7506ad7dcc8264d /src/lib/libc/stdlib
parent1874b023f58612fb7b0d26839af9561babb2e1d1 (diff)
downloadopenbsd-28466dd8a1227d2d5931b7fc1510d78bd68967e8.tar.gz
openbsd-28466dd8a1227d2d5931b7fc1510d78bd68967e8.tar.bz2
openbsd-28466dd8a1227d2d5931b7fc1510d78bd68967e8.zip
explain more precisely how to initialize malloc_options;
OK deraadt@
Diffstat (limited to 'src/lib/libc/stdlib')
-rw-r--r--src/lib/libc/stdlib/malloc.316
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3
index b0c6fb782b..361fbe4d1d 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.143 2025/05/23 00:40:05 deraadt Exp $ 33.\" $OpenBSD: malloc.3,v 1.144 2025/05/24 12:47:11 schwarze Exp $
34.\" 34.\"
35.Dd $Mdocdate: May 23 2025 $ 35.Dd $Mdocdate: May 24 2025 $
36.Dt MALLOC 3 36.Dt MALLOC 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
@@ -266,10 +266,18 @@ value of the
266.Xr sysctl 2 , 266.Xr sysctl 2 ,
267next checks the environment for a variable called 267next checks the environment for a variable called
268.Ev MALLOC_OPTIONS , 268.Ev MALLOC_OPTIONS ,
269and finally looks at the pre-initialized global variable 269and finally looks at the global variable
270.Va malloc_options 270.Va malloc_options
271in the program. 271in the program.
272Each is scanned for the flags documented below. 272Since
273.Fn malloc
274might already get called before the beginning of
275.Fn main ,
276either initialize
277.Va malloc_options
278to a string literal at file scope or do not declare it at all.
279.Pp
280Each of the three strings is scanned for the flags documented below.
273Unless otherwise noted uppercase means on, lowercase means off. 281Unless otherwise noted uppercase means on, lowercase means off.
274During initialization, flags occurring later modify the behaviour 282During initialization, flags occurring later modify the behaviour
275that was requested by flags processed earlier. 283that was requested by flags processed earlier.