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)
Feb 15 2024, 1:41 AM
Unknown Object (File)
Feb 15 2024, 1:40 AM
Unknown Object (File)
Feb 15 2024, 1:40 AM
Unknown Object (File)
Feb 15 2024, 1:38 AM
Unknown Object (File)
Dec 22 2023, 9:34 PM
Unknown Object (File)
Dec 22 2023, 9:32 PM
Unknown Object (File)
Dec 20 2023, 10:24 PM
Unknown Object (File)
Nov 22 2023, 3:37 AM
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 Not Applicable
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.