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
Suggested by: jhb (see D46657)
Reviewed by: jhb, markj
Differential Revision: https://reviews.freebsd.org/D49571

(cherry picked from commit 1c95d401ebe5075ebb38b57638830713a496f107)

Details

Provenance
bzAuthored on Sat, Mar 29, 5:05 PM
Reviewer
jhb
Differential Revision
D49571: LinuxKPI: implement krealloc() for memory being contiguous
Parents
rG3404752d554f: LinuxKPI: switch mallocarray to an lkpi implementation using __kmalloc()
Branches
Unknown
Tags
Unknown