0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-09-18 19:35:20 +00:00

Marking resource functions with non-NULL compiler flags

This commit is contained in:
Maria Matejka 2020-04-27 16:14:17 +02:00
parent 6768bc568b
commit c92c8c6913
3 changed files with 7 additions and 7 deletions

View File

@ -65,8 +65,8 @@ static struct resclass lp_class = {
* The linear pool consists of a list of memory chunks of size at least
* @blk.
*/
linpool
*lp_new(pool *p, uint blk)
linpool * NONNULL(1)
lp_new(pool *p, uint blk)
{
linpool *m = ralloc(p, &lp_class);
m->chunk_size = blk;

View File

@ -334,7 +334,7 @@ static struct resclass mb_class = {
* chunk, not to the resource, hence you have to free it using
* mb_free(), not rfree().
*/
void *
void * NONNULL(1)
mb_alloc(pool *p, unsigned size)
{
struct mblock *b = xmalloc(sizeof(struct mblock) + size);
@ -359,7 +359,7 @@ mb_alloc(pool *p, unsigned size)
* chunk, not to the resource, hence you have to free it using
* mb_free(), not rfree().
*/
void *
void * NONNULL(1)
mb_allocz(pool *p, unsigned size)
{
void *x = mb_alloc(p, size);

View File

@ -50,8 +50,8 @@ extern pool root_pool;
/* Normal memory blocks */
void *mb_alloc(pool *, unsigned size);
void *mb_allocz(pool *, unsigned size);
void *mb_alloc(pool *, unsigned size) NONNULL(1);
void *mb_allocz(pool *, unsigned size) NONNULL(1);
void *mb_realloc(void *m, unsigned size);
void mb_free(void *);
@ -64,7 +64,7 @@ typedef struct lp_state {
byte *ptr;
} lp_state;
linpool *lp_new(pool *, unsigned blk);
linpool *lp_new(pool *, unsigned blk) NONNULL(1);
void *lp_alloc(linpool *, unsigned size); /* Aligned */
void *lp_allocu(linpool *, unsigned size); /* Unaligned */
void *lp_allocz(linpool *, unsigned size); /* With clear */