HomeFreeBSD

kern_malloc: fold free and zfree together into one __always_inline func

Description

kern_malloc: fold free and zfree together into one __always_inline func

free() and zfree() are essentially the same copy and pasted code with
the extra explicit_bzero() (and formerly kasan) calls. Add a bool to add
the extra functionality and make both functions a wrapper around the common
code and let the compiler do the optimization based on the bool input
when inlining.

No functional changes intended.

Suggested by: kib (in D45812)
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D46101

Details

Provenance
bzAuthored on Jul 24 2024, 3:56 PM
Reviewer
kib
Differential Revision
D46101: kern_malloc: fold free and zfree together into one __always_inline func
Parents
rGd1bdc2821fcd: Deprecate contigfree(9) in favour of free(9)
Branches
Unknown
Tags
Unknown