Reimplementation of Pijul in C, for education, fun and absolutely no profit

changestore: load changes on demand

Add a changestoreload() that checks the capacity of the current changestore, and loads in a new change by its hash.

This allows loading changes dynamically as needed so there is no need to preload anything. On our worstcase (check2) test target, the memory usage drops from 140MB to around 50MB, and the number allocations drop from 1204 to 326.

The xrealloc() function cannot zero out new memory, which can cause segfaults because garbage data is treated as non-NULL pointer values and passed to free(). To work around this, we initialize optional values to NULL as needed.

Created by  laumann  on July 20, 2023
QSQNGA5KZ4BVWE4FUJUMOP6SJRIXAC2PYU6JSRG5KXWLYWZZMAJQC
Change contents