On Mon, Jul 21, 2014 at 06:59:12AM +0000, Doug Hogan wrote: > -objects and checks for arithmetic overflow. > +objects and calls > +.Xr panic 9 > +on arithmetic overflow.
That is misleading in the M_CANFAIL case. I'm not terribly good at wording things, but I suggest something more like this instead: Index: malloc.9 =================================================================== RCS file: /cvs/src/share/man/man9/malloc.9,v retrieving revision 1.56 diff -u -p -r1.56 malloc.9 --- malloc.9 12 Jul 2014 18:51:10 -0000 1.56 +++ malloc.9 22 Jul 2014 06:48:28 -0000 @@ -97,16 +97,14 @@ or .Dv M_WAITOK must be specified. .It Dv M_CANFAIL -In the +If using +.Fn mallocarray +and arithmetic would overflow, or if .Dv M_WAITOK -case, if not enough memory is available, return +is also specified and not enough memory is available, then .Dv NULL -instead of calling +is returned instead of calling .Xr panic 9 . -.Dv M_CANFAIL -has no effect if -.Dv M_NOWAIT -is specified. .It Dv M_ZERO Causes .Fn malloc