libk  Diff

Differences From Artifact [5405a3e53e]:

To Artifact [73d0a96333]:


     8      8   
     9      9   kmem supplies two module-level functions, used to interact with the `kmptr` container type.
    10     10   
    11     11    * `kmfree(kmptr) → void` - free, downref, or ignore the pasted object as appropriate
    12     12    * `kmshred(kmptr) → void` - free, downref, or ignore the pasted object as appropriate. if deallocating, zero its contents
    13     13    * `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 }`.
    14     14    * `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.
           15  + * `kmzero(void*,sz) → void` - zeroes a region of memory
           16  + * `kmozero(kmptr) → void` - zeroes an object in memory
           17  + * `kmcopy(void* dest, void* src, sz) → void` - copies one region of memory to another
           18  + * `kmdup(kmptr) → kmptr` - duplicates an object in memory, allocating it as sibling of the original
    15     19   
    16     20   ## types
    17     21   
    18     22   kmem defines the following types:
    19     23    
    20     24    * `enum kmkind` - enumerates allocation strategies
    21     25    * `struct kmptr` - abstract pointer object