diff options
author | Maria Matejka <mq@ucw.cz> | 2022-10-04 15:40:52 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-10-04 15:40:52 +0200 |
commit | becca314e2546d6005a23398ce2d3012d4b396cb (patch) | |
tree | bdd2f55e81d42e6a1108593840c9273106676e09 /lib/resource.h | |
parent | 61c127c021ac34eba25d3245ccf8f9eb9dd352f5 (diff) | |
parent | 0072d11f3431165240656edf6ade473554b8747e (diff) |
Merge commit '0072d11f' into tmp-learn
Diffstat (limited to 'lib/resource.h')
-rw-r--r-- | lib/resource.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/resource.h b/lib/resource.h index 4cedbf00..5ad011ec 100644 --- a/lib/resource.h +++ b/lib/resource.h @@ -40,7 +40,12 @@ struct resclass { /* Generic resource manipulation */ -typedef struct pool pool; +typedef struct pool { + resource r; + list inside; + const char *name; +} pool; + void resource_init(void); pool *rp_new(pool *, const char *); /* Create new pool */ @@ -115,6 +120,7 @@ void sl_free(void *); void buffer_realloc(void **buf, unsigned *size, unsigned need, unsigned item_size); /* Allocator of whole pages; for use in slabs and other high-level allocators. */ +#define PAGE_HEAD(x) ((void *) (((uintptr_t) (x)) & ~(page_size-1))) extern long page_size; void *alloc_page(void); void free_page(void *); |