Start on caller-provided space (a record builder's stack array). Growth past * it moves to the heap once; a buffer that never outgrows it never allocates. */
| 310 | /* Start on caller-provided space (a record builder's stack array). Growth past |
| 311 | * it moves to the heap once; a buffer that never outgrows it never allocates. */ |
| 312 | static void dynbuf_init_inline(DynBuf *b, uint8_t *space, int cap) { |
| 313 | b->data = space; |
| 314 | b->len = 0; |
| 315 | b->cap = cap; |
| 316 | b->heap = false; |
| 317 | } |
| 318 | |
| 319 | static bool dynbuf_ensure(DynBuf *b, int needed) { |
| 320 | if (b->len + needed <= b->cap) { |