HomeFreeBSD

LinuxKPI: implement krealloc() for memory being contiguous

Description

LinuxKPI: implement krealloc() for memory being contiguous

Implement krealloc_array() using krealloc(). Implement krealloc()
doing the various size checks ourselves and use realloc() or kmalloc()
depending on old and new allocation sizes.
This way we can ensure that allocated memory stays physically contiguous.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Suggested by: jhb (see D46657)
Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D49571

Details

Provenance
bzAuthored on Mar 29 2025, 5:05 PM
Reviewer
jhb
Differential Revision
D49571: LinuxKPI: implement krealloc() for memory being contiguous
Parents
rGc5cf4b64f4a9: malloc: extend malloc_usable_size() for contigmalloc
Branches
Unknown
Tags
Unknown