ASSERT(!c->obstacle_count);
- rfree(c->pool);
+ rp_free(c->pool);
}
/**
tmp_flush(void)
{
lp_flush(tmp_linpool);
- rfree(tmp_res.pool);
+ rp_free(tmp_res.pool);
tmp_res.pool = rp_new(tmp_res.parent, "TMP");
}
return;
struct mblock *b = SKIP_BACK(struct mblock, data, m);
- rfree(b);
+ rfree(&b->r);
}
void *ralloc(pool *, struct resclass *);
+pool *rp_new(pool *, const char *); /* Create a new pool */
+pool *rp_newf(pool *, const char *, ...); /* Create a new pool with a formatted string as its name */
+void rp_init(pool *, const char *); /* Init a new pool */
+void rp_initf(pool *, const char *, ...); /* Init a new pool with a formatted string as its name */
+static inline void rp_free(pool *p) { rfree(&p->r); } /* Free the whole pool */
+
extern pool root_pool;
/* Normal memory blocks */
void *sl_alloc(slab *);
void *sl_allocz(slab *);
void sl_free(void *);
+void sl_delete(slab *);
/*
* Low-level memory allocation functions, please don't use
c->sock = NULL;
}
else
- rfree(c->pool);
+ rp_free(c->pool);
}
/**
{
CALL(p->proto->cleanup, p);
- rfree(p->pool);
+ rp_free(p->pool);
p->pool = NULL;
p->active = 0;
req->hook = NULL;
/* And free the CLI (deferred) */
- rfree(d->cli->pool);
+ rp_free(d->cli->pool);
}
static int
rem_node(&hook->n);
/* Free the hook itself together with its pool */
- rfree(hook->pool);
+ rp_free(hook->pool);
}
static inline void
rem_node(NODE ifa);
- rfree(ifa->pool); /* contains ifa itself, locks, socket, etc */
+ rp_free(ifa->pool); /* contains ifa itself, locks, socket, etc */
}
static int
ASSERT_DIE(c->ptx);
ASSERT_DIE(c->ptx->pool);
- rfree(c->ptx->pool);
+ rp_free(c->ptx->pool);
c->ptx = NULL;
}
config_del_obstacle(s->config);
- rfree(s->pool);
+ rp_free(s->pool);
}
ospf_iface_sm(ifa, ISM_DOWN);
rem_node(NODE ifa);
- rfree(ifa->pool);
+ rp_free(ifa->pool);
}
void
s_get(&(n->dbsi));
release_lsrtl(p, n);
rem_node(NODE n);
- rfree(n->pool);
+ rp_free(n->pool);
OSPF_TRACE(D_EVENTS, "Neighbor %R on %s removed", rid, ifa->ifname);
}
rem_node(NODE ifa);
- rfree(ifa->pool);
+ rp_free(ifa->pool);
}
static void
pthread_attr_destroy(&thr->thread_attr);
/* Free all remaining memory */
- rfree(thr->pool);
+ rp_free(thr->pool);
}
static struct bird_thread *
/* Stop the meta loop */
birdloop_leave(thr->meta);
domain_free(thr->meta->time.domain);
- rfree(thr->meta->pool);
+ rp_free(thr->meta->pool);
/* Local pages not needed anymore */
flush_local_pages();
cli_write_trigger(tsd->cli);
DOMAIN_FREE(control, tsd->lock);
- rfree(tsd->pool);
+ rp_free(tsd->pool);
the_bird_unlock();
}
ASSERT_DIE(loop->thread == NULL);
domain_free(loop->time.domain);
- rfree(loop->pool);
+ rp_free(loop->pool);
}
static void