Page MenuHomeFreeBSD

malloc: delegate M_EXEC handling to malloc_exec + clean up a little
ClosedPublic

Authored by mjg on Fri, Oct 30, 3:19 PM.

Details

Summary

This removes a branch for handling an almost-unused case.

Slight clean up is in preparation for resurecting the fast path malloc/free patch.

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

mjg requested review of this revision.Fri, Oct 30, 3:19 PM

I think this is fine. I wouldn't even bother with malloc_exec(), you could just modify the few existing users to call kmem_malloc(M_EXEC).

In either case, a man page update is needed.

sys/kern/kern_malloc.c
657 ↗(On Diff #78951)

and -> an

They had kmem_malloc and that got patched to malloc(...., M_EXEC) so I did not deviate from the general direction. That said, I'm indifferent to this one as long as the flag is gone from malloc itself.

In D27019#602758, @mjg wrote:

They had kmem_malloc and that got patched to malloc(...., M_EXEC) so I did not deviate from the general direction. That said, I'm indifferent to this one as long as the flag is gone from malloc itself.

It was malloc(), then r317072 changed to kmem_malloc(), then it was changed back when M_EXEC was added.

I don't have strong feelings either way; the main advantage of malloc_exec() is malloc type tracking. If you prefer having malloc_exec() then this diff LGTM so long as the man page is updated.

  • also patch malloc_domainset
  • manpage
markj added inline comments.
share/man/man9/malloc.9
93 ↗(On Diff #78977)

There should be a newline after the first period.

Note -> Not

This revision is now accepted and ready to land.Fri, Oct 30, 7:46 PM