- struct table *t;
-
- t = pool_create_container (struct table, container);
- t->n[TABLE_HORZ] = nc;
- t->n[TABLE_VERT] = nr;
- t->h[TABLE_HORZ][0] = hl;
- t->h[TABLE_HORZ][1] = hr;
- t->h[TABLE_VERT][0] = ht;
- t->h[TABLE_VERT][1] = hb;
- t->ref_cnt = 1;
-
- t->cc = pool_calloc (t->container, nr * nc, sizeof *t->cc);
- t->cp = pool_calloc (t->container, nr * nc, sizeof *t->cp);
-
- t->rh = pool_nmalloc (t->container, nc, nr + 1);
- memset (t->rh, TABLE_STROKE_NONE, nc * (nr + 1));
-
- t->rv = pool_nmalloc (t->container, nr, nc + 1);
- memset (t->rv, TABLE_STROKE_NONE, nr * (nc + 1));
-
- memset (t->styles, 0, sizeof t->styles);
- memset (t->rule_colors, 0, sizeof t->rule_colors);
-
+ struct pool *pool = pool_create ();
+ struct table *t = pool_alloc (pool, sizeof *t);
+ *t = (struct table) {
+ .container = pool,
+ .n = { [H] = nc, [V] = nr },
+ .h = { [H] = { hl, hr }, [V] = { ht, hb } },
+ .ref_cnt = 1,
+ .cc = pool_calloc (pool, nr * nc, sizeof *t->cc),
+ .cp = pool_calloc (pool, nr * nc, sizeof *t->cp),
+ .rh = pool_calloc (pool, nc, nr + 1),
+ .rv = pool_nmalloc (pool, nr, nc + 1),
+ };