diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2023-04-08 20:24:44 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2023-04-08 20:24:44 +0000 |
commit | bd43bd6f1ae1b1ec7ee6873d9fd6766b049802e9 (patch) | |
tree | 6b846a12ebf42feaf394de84ab663d6c3314d984 /sys/include | |
parent | 26e42d115979009c9fe144e1c28f740485537674 (diff) |
libc: Add poolreset() function
This is intended for the secrmem pool in the kernel,
but could also be used for temporary pools to
recover the memory used by the arenas.
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/pool.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/include/pool.h b/sys/include/pool.h index 5f7fada45..55ca6f59d 100644 --- a/sys/include/pool.h +++ b/sys/include/pool.h @@ -17,6 +17,7 @@ struct Pool { void* (*alloc)(ulong); int (*merge)(void*, void*); void (*move)(void* from, void* to); + void (*free)(void*, ulong); int flags; int nfree; @@ -36,6 +37,7 @@ extern void* poolallocalign(Pool*, ulong, ulong, long, ulong); extern void poolfree(Pool*, void*); extern ulong poolmsize(Pool*, void*); extern int poolisoverlap(Pool*, void*, ulong); +extern void poolreset(Pool*); extern void* poolrealloc(Pool*, void*, ulong); extern void poolcheck(Pool*); extern int poolcompact(Pool*); |