8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
kmem supplies two module-level functions, used to interact with the `kmptr` container type.
* `kmfree(kmptr) → void` - free, downref, or ignore the pasted object as appropriate
* `kmshred(kmptr) → void` - free, downref, or ignore the pasted object as appropriate. if deallocating, zero its contents
* `kmstat(void*) → kmptr` - convenience function to wrap a pointer to a non-managed object in a `kmptr` struct, so it can be passed to functions that accept arbitrary objects. `kmptr p = kmstat(raw)` is equivalent to `kmptr p = { kmkind_none, raw, NULL }`.
* `kmtaint(&kmptr) → void` - "taints" a `kmptr` object by setting it to be shredded when freed. this may be desirable if the object pointed to contains privileged information.
## types
kmem defines the following types:
* `enum kmkind` - enumerates allocation strategies
* `struct kmptr` - abstract pointer object
|
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
kmem supplies two module-level functions, used to interact with the `kmptr` container type.
* `kmfree(kmptr) → void` - free, downref, or ignore the pasted object as appropriate
* `kmshred(kmptr) → void` - free, downref, or ignore the pasted object as appropriate. if deallocating, zero its contents
* `kmstat(void*) → kmptr` - convenience function to wrap a pointer to a non-managed object in a `kmptr` struct, so it can be passed to functions that accept arbitrary objects. `kmptr p = kmstat(raw)` is equivalent to `kmptr p = { kmkind_none, raw, NULL }`.
* `kmtaint(&kmptr) → void` - "taints" a `kmptr` object by setting it to be shredded when freed. this may be desirable if the object pointed to contains privileged information.
* `kmzero(void*,sz) → void` - zeroes a region of memory
* `kmozero(kmptr) → void` - zeroes an object in memory
* `kmcopy(void* dest, void* src, sz) → void` - copies one region of memory to another
* `kmdup(kmptr) → kmptr` - duplicates an object in memory, allocating it as sibling of the original
## types
kmem defines the following types:
* `enum kmkind` - enumerates allocation strategies
* `struct kmptr` - abstract pointer object
|