replacement in change.c at line 522
[5.2010]→[4.598:673](∅→∅) − struct changestore *changes, struct atom *change, u8 *contents,
− usize *n
+ struct changestore *changes, struct atom *change, u8 *contents, usize *n
replacement in change.c at line 572
[5.608]→[5.3360:3381](∅→∅),
[5.3360]→[5.3360:3381](∅→∅),
[5.3381]→[4.825:856](∅→∅),
[4.856]→[5.3417:3425](∅→∅),
[5.3417]→[5.3417:3425](∅→∅) − buf = xrealloc(
− buf, sz + sizeof(u8) * z
− );
+ buf = xrealloc(buf, sz + sizeof(u8) * z);
replacement in change.c at line 689
[5.609]→[4.1043:1103](∅→∅),
[4.1103]→[5.674:687](∅→∅),
[5.674]→[5.674:687](∅→∅) − struct changestore *changes, struct atom *a, u8 *contents,
− int verbose
+ struct changestore *changes, struct atom *a, u8 *contents, int verbose
replacement in change.c at line 756
[5.2775]→[5.2775:2800](∅→∅),
[5.2800]→[4.1215:1273](∅→∅),
[4.1273]→[5.2864:2866](∅→∅),
[5.2864]→[5.2864:2866](∅→∅) − read_filemetadata_noenc(
− struct filemetadata *m, u8 *contents, usize contents_len
− )
+ read_filemetadata_noenc(struct filemetadata *m, u8 *contents, usize contents_len)
replacement in change.c at line 769
− print_raw_change(struct changestore *changes, struct change *ch)
+ print_raw_change(struct change *ch)
replacement in change.c at line 1108
− * load a change by the given hash into the changestore
+ * Load a change by the given hash into the changestore.
+ *
+ * This function may realloc the underlying memory, so callers must
+ * ensure they are not holding any references to any changes.
edit in change.c at line 1141
+ changefree(struct change *c)
+ {
+ hashedfree(&c->hashed);
+ if (c->contents)
+ free(c->contents);
+ }
+
+ void
edit in change.c at line 1161
[4.1624]→[5.1575:1594](∅→∅),
[5.1575]→[5.1575:1594](∅→∅) replacement in change.c at line 1164
[5.1661]→[5.1661:1757](∅→∅) − c = &s->entries[i].change;
− hashedfree(&c->hashed);
− if (c->contents)
− free(c->contents);
+ changefree(&s->entries[i].change);
replacement in change.c at line 1211
[5.8253]→[5.8253:8278](∅→∅),
[5.8278]→[4.1639:1649](∅→∅),
[4.1649]→[5.8292:8293](∅→∅),
[5.3556]→[5.8292:8293](∅→∅),
[5.8292]→[5.8292:8293](∅→∅),
[5.8293]→[5.513:560](∅→∅),
[5.560]→[5.8329:8360](∅→∅),
[5.2474]→[5.8329:8360](∅→∅),
[5.8329]→[5.8329:8360](∅→∅) − struct changeentry *ch;
− usize x;
−
− changestoreinit(&changestore, 4, repo->path);
− ch = &changestore.entries[0];
+ struct change c = { 0 };
+ struct hash h = { 0 };
replacement in change.c at line 1214
[5.8361]→[2.15099:15160](∅→∅) − err = loadchange(&ch->change, &ch->hash, repo->path, hash);
+ err = loadchange(&c, &h, repo->path, hash);
edit in change.c at line 1217
[2.15179]→[2.15179:15180](∅→∅),
[2.15180]→[5.0:26](∅→∅),
[5.8452]→[5.0:26](∅→∅) −
− changestore.len = x = 1;
replacement in change.c at line 1218
[5.8483]→[5.8483:8516](∅→∅) − changestore.entries[0].num = 1;
+ changestoreinit(&changestore, 4, repo->path);
replacement in change.c at line 1221
− print_raw_change(&changestore, &ch->change);
replacement in change.c at line 1223
− print_change(
− &changestore, &ch->change.hashed, ch->change.contents,
− verbose
− );
+ print_change(&changestore, &c.hashed, c.contents, verbose);
edit in change.c at line 1227