struct pool {
resource r;
list inside;
+ char *name;
};
static void pool_dump(resource *);
static int indent;
pool *
-rp_new(pool *p)
+rp_new(pool *p, char *name)
{
pool *z = ralloc(p, &pool_class);
init_list(&z->inside);
pool *p = (pool *) P;
resource *r;
- debug("\n");
+ debug(" %s\n", p->name);
indent += 3;
WALK_LIST(r, p->inside)
rdump(r);
resource_init(void)
{
root_pool.r.class = &pool_class;
+ root_pool.name = "Root";
init_list(&root_pool.inside);
}
typedef struct pool pool;
void resource_init(void);
-pool *rp_new(pool *); /* Create new pool */
+pool *rp_new(pool *, char *); /* Create new pool */
void rp_free(pool *); /* Free everything in the pool */
void rfree(void *); /* Free single resource */
void rdump(void *); /* Dump to debug output */
void
rta_init(void)
{
- rta_pool = rp_new(&root_pool);
+ rta_pool = rp_new(&root_pool, "Attributes");
rta_slab = sl_new(rta_pool, sizeof(rta));
}