Skip to content

Commit

Permalink
vere: adds --gc-early flag to pack and meld subcommands (#615)
Browse files Browse the repository at this point in the history
Same as #613 but for the `release` branch.
  • Loading branch information
pkova authored Mar 5, 2024
2 parents 2006feb + 04d95d0 commit 65ae693
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/noun/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,15 @@ u3m_boot(c3_c* dir_c, size_t len_i)
*/
u3m_pave(nuu_o);

/* GC immediately if requested
*/
if ( (c3n == nuu_o) && (u3C.wag_w & u3o_check_corrupt) ) {
u3l_log("boot: gc requested");
u3m_grab(u3_none);
u3C.wag_w &= ~u3o_check_corrupt;
u3l_log("boot: gc complete");
}

/* Initialize the jet system.
*/
{
Expand Down
12 changes: 12 additions & 0 deletions pkg/vere/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,7 @@ _cw_meld(c3_i argc, c3_c* argv[])
{ "no-demand", no_argument, NULL, 6 },
{ "swap", no_argument, NULL, 7 },
{ "swap-to", required_argument, NULL, 8 },
{ "gc-early", no_argument, NULL, 9 },
{ NULL, 0, NULL, 0 }
};

Expand Down Expand Up @@ -1931,6 +1932,11 @@ _cw_meld(c3_i argc, c3_c* argv[])
break;
}

case 9: { // gc-early
u3C.wag_w |= u3o_check_corrupt;
break;
}

case '?': {
fprintf(stderr, "invalid argument\r\n");
exit(1);
Expand Down Expand Up @@ -2063,6 +2069,7 @@ _cw_pack(c3_i argc, c3_c* argv[])
{ "no-demand", no_argument, NULL, 6 },
{ "swap", no_argument, NULL, 7 },
{ "swap-to", required_argument, NULL, 8 },
{ "gc-early", no_argument, NULL, 9 },
{ NULL, 0, NULL, 0 }
};

Expand Down Expand Up @@ -2093,6 +2100,11 @@ _cw_pack(c3_i argc, c3_c* argv[])
break;
}

case 9: { // gc-early
u3C.wag_w |= u3o_check_corrupt;
break;
}

case '?': {
fprintf(stderr, "invalid argument\r\n");
exit(1);
Expand Down

0 comments on commit 65ae693

Please sign in to comment.