+
+ /* --- Reallocate the block --- *
+ *
+ * If I'm not changing the base offset then it's worth using @realloc@;
+ * otherwise there'll probably be two calls to @memcpy@ to shunt the data
+ * around so it's not worth bothering.
+ */
+
+ if (p && slots == b->off) {
+ q = x_realloc(b->a, p - b->off * sz, nsz * sz);
+ q += slots * sz;
+ } else {
+ q = x_alloc(b->a, nsz * sz);
+ q += slots * sz;
+ if (p) {
+ memcpy(q, p, b->len * sz);
+ x_free(b->a, p - b->off * sz);
+ }
+ }
+
+ /* --- Fill in the other parts of the base structure --- */
+