opnsense-src/share
Bjoern A. Zeeb 1eb6c9cfc9 malloc(9): extend contigmalloc(9) by a "slab cookie"
Extend kern_malloc.c internals to also cover contigmalloc(9) by a
"slab cookie" and not just malloc/malloc_large.  This allows us to
call free(9) even on contigmalloc(9) addresses and deprecate
contigfree(9).  Update the contigmalloc(9) man page accordingly.

The way this is done (free(9) working for contigmalloc) will hide the
UMA/VM bits from a consumer which may otherwise need to know whether
the original allocation was by malloc or contigmalloc by looking at
the cookie (likely via an accessor function).  This simplifies
the implementation of consumers of mixed environments a lot.

This is preliminary work to allow LinuxKPI to be adjusted to better
play by the rules Linux puts out for various allocations.
Most of this was described/explained to me by jhb.

One may observe that realloc(9) is currently unchanged (and contrary
to [contig]malloc/[contig]free an implementation may need access
the "slab cookie" information given it will likely be implementation
dependent which allocation type to use if size changes beyond the
usable size of the initial allocation).

Described by:	jhb
Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj, kib
Differential Revision: https://reviews.freebsd.org/D45812

(cherry picked from commit 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b)
2024-09-28 10:35:11 +00:00
..
colldef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
colldef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ctypedef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
dict Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
doc Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
dtrace Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
examples targ: fix compiling the example 2024-09-19 14:25:09 -06:00
i18n Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
keys Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
man malloc(9): extend contigmalloc(9) by a "slab cookie" 2024-09-28 10:35:11 +00:00
misc usb_vendors: update to 2024.07.04 2024-09-03 09:06:56 +02:00
mk src.conf: Add a MK_ZFS_TESTS knob 2024-09-20 11:39:16 +00:00
monetdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
monetdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
msgdef msgdef: fix NO and SI locales 2023-11-28 14:12:11 +07:00
msgdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
numericdef_unicode Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
security Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sendmail Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
skel Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
snmp Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
syscons Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tabset Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
termcap Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
timedef Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
vt Trim various $FreeBSD$ 2023-10-24 11:22:23 -07:00
zoneinfo Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.inc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00