@ai-ecoverse/slicc-kernel 1.102.3 → 1.102.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2233,7 +2233,7 @@ var init_wasi_fds = __esm({
2233
2233
  }
2234
2234
  flushPath(path) {
2235
2235
  for (const [p, buffer] of this.buffers) if (within(p, path)) buffer.flush();
2236
- if (this.shared) this.kernel.call({ op: "fd-path-flush", path });
2236
+ if (this.shared && !this.fs.changes?.clean()) this.kernel.call({ op: "fd-path-flush", path });
2237
2237
  }
2238
2238
  holdsUnder(path) {
2239
2239
  for (const p of this.buffers.keys()) if (within(p, path)) return true;
@@ -4774,7 +4774,7 @@ var KERNEL_VERSION, OS_RELEASE;
4774
4774
  var init_version = __esm({
4775
4775
  "src/version.ts"() {
4776
4776
  "use strict";
4777
- KERNEL_VERSION = true ? "1.102.3" : "0.0.0-dev";
4777
+ KERNEL_VERSION = true ? "1.102.4" : "0.0.0-dev";
4778
4778
  OS_RELEASE = "6.0.0-slicc";
4779
4779
  }
4780
4780
  });
@@ -6414,7 +6414,7 @@ function normal(path) {
6414
6414
  }
6415
6415
  return `/${parts.join("/")}`;
6416
6416
  }
6417
- var GEN2, RING2, RING_SIZE2, SLOT2, CHANGES_BYTES, ChangeView;
6417
+ var GEN2, RING2, RING_SIZE2, SLOT2, DIRTY, CHANGES_BYTES, ChangeView;
6418
6418
  var init_changes = __esm({
6419
6419
  "src/fs/changes.ts"() {
6420
6420
  "use strict";
@@ -6422,7 +6422,8 @@ var init_changes = __esm({
6422
6422
  RING2 = 1;
6423
6423
  RING_SIZE2 = 4096;
6424
6424
  SLOT2 = 2;
6425
- CHANGES_BYTES = (RING2 + RING_SIZE2 * SLOT2) * 4;
6425
+ DIRTY = RING2 + RING_SIZE2 * SLOT2;
6426
+ CHANGES_BYTES = (DIRTY + 1) * 4;
6426
6427
  ChangeView = class {
6427
6428
  view;
6428
6429
  constructor(sab) {
@@ -6431,6 +6432,9 @@ var init_changes = __esm({
6431
6432
  now() {
6432
6433
  return Atomics.load(this.view, GEN2);
6433
6434
  }
6435
+ clean() {
6436
+ return this.view.length > DIRTY && Atomics.load(this.view, DIRTY) === 0;
6437
+ }
6434
6438
  changedSince(seen, path) {
6435
6439
  const now = Atomics.load(this.view, GEN2);
6436
6440
  const distance = now - seen >>> 0;