| 461 | } |
| 462 | |
| 463 | static uint8_t *rec_finalize(RecordBuilder *r, int *out_len) { |
| 464 | *out_len = 0; |
| 465 | int total = rec_payload_len(r); |
| 466 | uint8_t *buf = (uint8_t *)malloc(total); |
| 467 | if (!buf) { |
| 468 | return NULL; |
| 469 | } |
| 470 | *out_len = rec_write(r, buf); |
| 471 | return buf; |
| 472 | } |
| 473 | |
| 474 | /* One index build's cells live in an arena: they are all released together |
| 475 | * once the B-tree is written, where a malloc + free per row was 12.1 M |
no test coverage detected