Commit c92c8c69 authored by Maria Matejka's avatar Maria Matejka
Browse files

Marking resource functions with non-NULL compiler flags

parent 6768bc56
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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 */