summaryrefslogtreecommitdiff
path: root/lib/resource.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-04-20 21:08:38 +0200
committerMaria Matejka <mq@ucw.cz>2023-04-22 20:49:58 +0200
commit1141ce4e2d924f29e6e31ccf5e325f870c8895dd (patch)
tree4d985af0d0008ca3468c614f157ef92f50b7df49 /lib/resource.h
parentb3f805ce29487f790090fcf31096f5a7cf1d585d (diff)
Resource pool closing has its dedicated function
Diffstat (limited to 'lib/resource.h')
-rw-r--r--lib/resource.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/resource.h b/lib/resource.h
index 911b990d..64803778 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -58,6 +58,12 @@ void rmove(void *, pool *); /* Move to a different pool */
void *ralloc(pool *, struct resclass *);
+pool *rp_new(pool *, const char *); /* Create a new pool */
+pool *rp_newf(pool *, const char *, ...); /* Create a new pool with a formatted string as its name */
+void rp_init(pool *, const char *); /* Init a new pool */
+void rp_initf(pool *, const char *, ...); /* Init a new pool with a formatted string as its name */
+static inline void rp_free(pool *p) { rfree(&p->r); } /* Free the whole pool */
+
extern pool root_pool;
/* Normal memory blocks */
@@ -111,6 +117,7 @@ slab *sl_new(pool *, unsigned size);
void *sl_alloc(slab *);
void *sl_allocz(slab *);
void sl_free(void *);
+void sl_delete(slab *);
/*
* Low-level memory allocation functions, please don't use