From 0f7feef5c7b52187cdb6a33062927bcdd2ae20ae Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 3 Nov 2022 20:44:58 -0400 Subject: [PATCH] vere: adds --no-demand argument to disable demand paging --- pkg/urbit/daemon/main.c | 20 ++++++++++++++++++++ pkg/urbit/include/vere/vere.h | 1 + 2 files changed, 21 insertions(+) diff --git a/pkg/urbit/daemon/main.c b/pkg/urbit/daemon/main.c index 486e496745..b9151f9570 100644 --- a/pkg/urbit/daemon/main.c +++ b/pkg/urbit/daemon/main.c @@ -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) ) { diff --git a/pkg/urbit/include/vere/vere.h b/pkg/urbit/include/vere/vere.h index f02bf4a46d..dd505d085c 100644 --- a/pkg/urbit/include/vere/vere.h +++ b/pkg/urbit/include/vere/vere.h @@ -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.