Page MenuHomeFreeBSD

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

Authored by dim on Sep 5 2020, 3:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 16, 4:42 PM
Unknown Object (File)
Oct 5 2024, 3:55 PM
Unknown Object (File)
Sep 30 2024, 12:14 PM
Unknown Object (File)
Sep 25 2024, 9:02 AM
Unknown Object (File)
Sep 25 2024, 6:25 AM
Unknown Object (File)
Sep 24 2024, 10:14 AM
Unknown Object (File)
Sep 23 2024, 5:09 AM
Unknown Object (File)
Sep 11 2024, 11:22 PM
Subscribers

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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33412
Build 30709: arc lint + arc unit

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.