diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2024-05-28 16:41:24 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2024-05-28 16:41:24 +0200 |
commit | 2d6fb31cd1142befb60cad15ce9da2a7eabb76e2 (patch) | |
tree | 4b0a29969a60864e3e9d17ebac29ad1fb0e066f3 /lib/resource.h | |
parent | e29f134ad9346343277b7cb4581d2a704592dc79 (diff) |
Lib: Use alloc_size() function attribute
Diffstat (limited to 'lib/resource.h')
-rw-r--r-- | lib/resource.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/resource.h b/lib/resource.h index a4e110a5..1e9a7b78 100644 --- a/lib/resource.h +++ b/lib/resource.h @@ -57,9 +57,9 @@ extern pool root_pool; /* Normal memory blocks */ -void *mb_alloc(pool *, unsigned size); -void *mb_allocz(pool *, unsigned size); -void *mb_realloc(void *m, unsigned size); +void *mb_alloc(pool *, unsigned size) ALLOC_SIZE(2); +void *mb_allocz(pool *, unsigned size) ALLOC_SIZE(2); +void *mb_realloc(void *m, unsigned size) ALLOC_SIZE(2); void mb_free(void *); /* Memory pools with linear allocation */ @@ -73,9 +73,9 @@ typedef struct lp_state { } lp_state; linpool *lp_new(pool *); -void *lp_alloc(linpool *, unsigned size); /* Aligned */ -void *lp_allocu(linpool *, unsigned size); /* Unaligned */ -void *lp_allocz(linpool *, unsigned size); /* With clear */ +void *lp_alloc(linpool *, unsigned size) ALLOC_SIZE(2); /* Aligned */ +void *lp_allocu(linpool *, unsigned size) ALLOC_SIZE(2); /* Unaligned */ +void *lp_allocz(linpool *, unsigned size) ALLOC_SIZE(2); /* With clear */ void lp_flush(linpool *); /* Free everything, but leave linpool */ void lp_save(linpool *m, lp_state *p); /* Save state */ void lp_restore(linpool *m, lp_state *p); /* Restore state */ |