I don't think the current man page has enough detail for what the
malloc.conf settings do.


Index: lib/libc/stdlib/malloc.3
===================================================================
RCS file: /cvs/src/lib/libc/stdlib/malloc.3,v
retrieving revision 1.78
diff -u -p -d -r1.78 malloc.3
--- lib/libc/stdlib/malloc.3    1 May 2014 18:41:59 -0000       1.78
+++ lib/libc/stdlib/malloc.3    11 Jul 2014 04:30:37 -0000
@@ -220,10 +220,16 @@ Malloc will first look for a symbolic li
 .Pa /etc/malloc.conf
 and next check the environment for a variable called
 .Ev MALLOC_OPTIONS
+(if not
+.Xr issetugid 2 )
 and finally for the global variable
 .Va malloc_options
 and scan them for flags in that order.
 Flags are single letters, uppercase means on, lowercase means off.
+
+The default flags are 'AP', small chunks are always junked, and the first
+part of the pages is junked after free.  The default junk behavior does not
+correspond to 'j' or 'J'.
 .Bl -tag -width indent
 .It Cm A
 .Dq Abort .
@@ -270,7 +276,7 @@ Fill some junk into the area allocated.
 Currently junk is bytes of 0xd0 when allocating; this is pronounced
 .Dq Duh .
 \&:-)
-Freed chunks are filled with 0xdf.
+Freed chunks are filled with 0xdf.  This performs more junking than by default.
 .It Cm j
 .Dq Don't Junk .
 By default, small chunks are always junked, and the first part of pages
@@ -297,6 +303,7 @@ This can substantially aid in compacting
 .\"Consult the source for this one.
 .It Cm S
 Enable all options suitable for security auditing.
+This currently enables flags 'UJG' and sets the free cache page size to 0.
 .It Cm U
 .Dq Free unmap .
 Enable use after free protection for larger allocations.

Reply via email to