Page MenuHomeFreeBSD

jemalloc: Fix activating debug on WITHOUT_MALLOC_PRODUCTION
ClosedPublic

Authored by olce on Thu, Oct 2, 10:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 10:09 AM
Unknown Object (File)
Fri, Oct 10, 10:09 AM
Unknown Object (File)
Fri, Oct 10, 10:09 AM
Unknown Object (File)
Fri, Oct 10, 3:40 AM
Unknown Object (File)
Thu, Oct 9, 3:13 AM
Unknown Object (File)
Wed, Oct 8, 2:28 AM
Unknown Object (File)
Thu, Oct 2, 2:25 PM
Unknown Object (File)
Thu, Oct 2, 2:18 PM

Details

Summary

When stable/14 was branched, MALLOC_PRODUCTION wasn't moved from
DEFAULT_NO_OPTIONS to DEFAULT_YES_OPTIONS but instead
'jemalloc_FreeBSD.h' was changed to stop defining JEMALLOC_DEBUG (and
also, strangely, to start defining MALLOC_PRODUCTION always, although
that does not have any effect in jemalloc's code).

While this effectively turned off jemalloc debugging, it also prevents
people from turning it on again. Additionally, leaving
MALLOC_PRODUCTION in __DEFAULT_NO_OPTIONS would be confusing.
Finally, this puts stable/14 in line with what was done for stable/15.

This is a direct commit to stable/14.

Fixes: 29a16ce065db ("release: update stable/14 following branching from main")
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Thu, Oct 2, 10:29 AM
olce added a reviewer: srcmgr.

When stable/14 was branched, MALLOC_PRODUCTION wasn't moved from
DEFAULT_NO_OPTIONS to DEFAULT_YES_OPTIONS but instead
'jemalloc_FreeBSD.h' was changed to stop defining JEMALLOC_DEBUG (and
also, strangely, to start defining MALLOC_PRODUCTION always, although
that does not have any effect in jemalloc's code).

lib/libc/stdlib/malloc/jemalloc/Makefile.inc still does this (defining MALLOC_PRODUCTION). I gather that that was the old name for the debug flag. I guess that should be removed too?

This revision is now accepted and ready to land.Fri, Oct 3, 12:53 PM

I guess that should be removed too?

No, this one must not without further changes. It's actually because the Makefile you mention defines MALLOC_PRODUCTION (on MK_MALLOC_PRODUCTION not begin no, or MALLOC_PRODUCTION being defined as an env or make var) that the code in jemalloc_FreeBSD.h can actually avoid defining JEMALLOC_DEBUG.

I guess that should be removed too?

No, this one must not without further changes. It's actually because the Makefile you mention defines MALLOC_PRODUCTION (on MK_MALLOC_PRODUCTION not begin no, or MALLOC_PRODUCTION being defined as an env or make var) that the code in jemalloc_FreeBSD.h can actually avoid defining JEMALLOC_DEBUG.

Oops, yes, I see.