summaryrefslogtreecommitdiff
path: root/lib/resource.h
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-04-28 23:48:03 +0200
committerMaria Matejka <mq@ucw.cz>2023-05-03 21:30:29 +0200
commit9f25dd79b8e9fdea9050c9f7e3a10cea8791d745 (patch)
tree3e72b3f665d6e18d65c25ad6baf37a015c8767bf /lib/resource.h
parent010c26c29602d52e704ea7cb83f2f6acacbddd0d (diff)
Allocation from linpools and slabs requires the appropriate lock to be taken
Diffstat (limited to 'lib/resource.h')
-rw-r--r--lib/resource.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/resource.h b/lib/resource.h
index 810334c1..06af4289 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -76,6 +76,9 @@ void rp_free(pool *p); /* Free the whole pool */
extern pool root_pool;
+static inline pool *resource_parent(resource *r)
+{ return SKIP_BACK(pool, inside, resource_enlisted(r)); }
+
/* Normal memory blocks */
void *mb_alloc(pool *, unsigned size);