HomeFreeBSD

Reduce NL_ARGMAX to 4096 to match Linux.

Description

Reduce NL_ARGMAX to 4096 to match Linux.

NL_ARGMAX is the maximum number of positional arguments supported by
printf(3). Prior to r308145 it was declared as 99 and not enforced.
r308145 added enforcement and increased the value to 64k.

Unfortunately, development versions of PostgreSQL used the system
definition to allocate and zero an NL_ARGMAX * 4 sized array on the
stack of its snprintf implementation with measurable performance
impacts. This has been fixed in new PostgreSQL versions, but it is
possible that other programs suffer from this problem.

A value of 4096 puts us on par with Linux and is certainly large enough
for any reasonable program.

Reviewed by: mjg
Reported by: mjg
Approved by: re (gjb)
Differential revision: https://reviews.freebsd.org/D17387
Differential revision: https://reviews.freebsd.org/D8286

Details

Provenance
brooksAuthored on
Reviewer
mjg
Differential Revision
D17387: Reduce NL_ARGMAX to 4096 to match Linux.
Parents
rS339183: amd64: hide non-erms jump label under non-erms copyin/copyout
Branches
Unknown
Tags
Unknown