mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 16:50:25 -04:00
malloc: extend malloc_usable_size() for contigmalloc
Extend malloc_usable_size() for contigmalloc; it seems the only
outside consumer is LinuxKPI ksize() which by itself has little to
no consumer either.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Suggested by: jhb (see D46657)
Reviewed by: jhb, markj
Fixes: 9e6544dd6e
Differential Revision: https://reviews.freebsd.org/D49571
This commit is contained in:
parent
1c81ebec74
commit
c5cf4b64f4
1 changed files with 3 additions and 0 deletions
|
|
@ -1142,6 +1142,9 @@ malloc_usable_size(const void *addr)
|
|||
case SLAB_COOKIE_MALLOC_LARGE:
|
||||
size = malloc_large_size(slab);
|
||||
break;
|
||||
case SLAB_COOKIE_CONTIG_MALLOC:
|
||||
size = round_page(contigmalloc_size(slab));
|
||||
break;
|
||||
default:
|
||||
__assert_unreachable();
|
||||
size = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue