Page MenuHomeFreeBSD

Turn MALLOC_PRODUCTION into a regular src.conf(5) option
ClosedPublic

Authored by dim on Sep 5 2020, 3:49 PM.

Details

Summary

For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
been used to turn off potentially expensive debug checks and statistics
gathering in the implementation of malloc(3).

It seems more consistent to turn this into a regular src.conf(5) option,
e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
be toggled similar to any other source build option, and turned on or
off by default for e.g. stable branches.

Test Plan

Build one world using WITH_MALLOC_PRODUCTION, another using
WITHOUT_MALLOC_PRODUCTION, and check that the malloc debugging is
correctly disabled and enabled.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dim requested review of this revision.Sep 5 2020, 3:49 PM

I don't have an opinion one way or the other, but if doing anything here I think it would be prudent to provide an umbrella option to disable all debugging facilities for userspace (read: include the compiler stuff). Can be a separate review.

This revision is now accepted and ready to land.Sep 5 2020, 4:58 PM
bcr added a subscriber: bcr.

OK from manpages.