Page MenuHomeFreeBSD

memfd_create: don't allocate heap memory
ClosedPublic

Authored by brooks on Nov 22 2023, 1:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 6 2024, 1:48 PM
Unknown Object (File)
Oct 5 2024, 12:01 AM
Unknown Object (File)
Oct 4 2024, 2:16 PM
Unknown Object (File)
Oct 1 2024, 7:38 PM
Unknown Object (File)
Oct 1 2024, 6:22 PM
Unknown Object (File)
Oct 1 2024, 3:10 PM
Unknown Object (File)
Oct 1 2024, 11:03 AM
Unknown Object (File)
Oct 1 2024, 8:57 AM
Subscribers
None

Details

Summary

Rather than calling calloc() to allocate space for a page size array to
pass to getpagesizes(), just follow the getpagesizes() implementation
and allocate MAXPAGESIZES elements on the stack. This avoids the need
for the allocation.

While this does mean that a new libc is required to take advantage of a
new huge page size, that was already true due to getpagesizes() using a
static buffer of MAXPAGESIZES elements.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 54558
Build 51447: arc lint + arc unit

Event Timeline

brooks created this revision.
This revision is now accepted and ready to land.Nov 22 2023, 1:46 AM
This revision now requires review to proceed.Nov 22 2023, 8:32 PM
This revision is now accepted and ready to land.Nov 22 2023, 9:43 PM
This revision was automatically updated to reflect the committed changes.