vere: adds --no-demand argument to disable demand paging

This commit is contained in:
Joe Bryan 2022-11-03 20:44:58 -04:00
parent b102cbb908
commit 0f7feef5c7
2 changed files with 21 additions and 0 deletions

View File

@ -153,6 +153,15 @@ _main_init(void)
//
u3_Host.ops_u.has = c3y;
// demand paging (ie, file-backed mapping for the loom)
// is not yet supported on windows
//
#ifdef U3_OS_mingw
u3_Host.ops_u.map = c3n;
#else
u3_Host.ops_u.map = c3y;
#endif
u3_Host.ops_u.net = c3y;
u3_Host.ops_u.lit = c3n;
u3_Host.ops_u.nuu = c3n;
@ -246,6 +255,7 @@ _main_getopt(c3_i argc, c3_c** argv)
{ "scry-format", required_argument, NULL, 'Z' },
//
{ "urth-loom", required_argument, NULL, 5 },
{ "no-demand", no_argument, NULL, 6 },
//
{ NULL, 0, NULL, 0 },
};
@ -266,6 +276,10 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.lut_y = lut_w;
break;
}
case 6: { // no-demand
u3_Host.ops_u.map = c3n;
break;
}
case 'X': {
u3_Host.ops_u.pek_c = strdup(optarg);
break;
@ -2146,6 +2160,12 @@ main(c3_i argc,
u3C.wag_w |= u3o_debug_ram;
}
/* Set no-demand flag.
*/
if ( !_(u3_Host.ops_u.map) ) {
u3C.wag_w |= u3o_no_demand;
}
/* Set profile flag.
*/
if ( _(u3_Host.ops_u.pro) ) {

View File

@ -313,6 +313,7 @@
c3_c* puf_c; // -Z, scry result format
c3_o con; // run conn
c3_o doc; // dock binary in pier
c3_o map; // --no-demand (reversed)
} u3_opts;
/* u3_host: entire host.