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)
Apr 25 2024, 1:41 AM
Unknown Object (File)
Feb 26 2024, 7:32 AM
Unknown Object (File)
Jan 19 2024, 7:41 PM
Unknown Object (File)
Dec 28 2023, 6:06 PM
Unknown Object (File)
Dec 28 2023, 6:06 PM
Unknown Object (File)
Dec 28 2023, 6:04 PM
Unknown Object (File)
Dec 28 2023, 6:04 PM
Unknown Object (File)
Dec 25 2023, 7:47 PM
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 Not Applicable
Unit
Tests Not Applicable

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.