On Fri, Jul 11, 2014 at 01:03:54AM -0600, Anthony J. Bentley wrote: > In addition to what jmc said, if you document these flags they need to > be marked up with the Cm macro instead of ASCII single quotes.
My mistake. Fixed version: 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 07:19:27 -0000 @@ -220,10 +220,23 @@ 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. +.Pp +The default flags are +.Cm A +and +.Cm P , +small chunks are always junked, and the first +part of the pages is junked after free. +The default junk behavior does not correspond to +.Cm j +or +.Cm J . .Bl -tag -width indent .It Cm A .Dq Abort . @@ -271,6 +284,7 @@ Currently junk is bytes of 0xd0 when all .Dq Duh . \&:-) 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 +311,11 @@ 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 +.Cm U , +.Cm J , +.Cm G +and sets the free cache page size to 0. .It Cm U .Dq Free unmap . Enable use after free protection for larger allocations.
