@orieg/expanse 0.6.0 → 0.7.0

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.
Files changed (3) hide show
  1. package/README.md +8 -0
  2. package/index.d.ts +1 -0
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -128,8 +128,16 @@ import { SyncExpanseMap, SyncExpanseSet } from '@orieg/expanse';
128
128
  const syncMap = new SyncExpanseMap();
129
129
  syncMap.set(1000n, 42n);
130
130
  console.log(syncMap.get(1000n)); // 42n
131
+ console.log(syncMap.next(1000n, true)); // { key: 1000n, value: 42n }
131
132
  ```
132
133
 
134
+ `SyncExpanseMap`'s `get`, `has`, `size`, `first`, `last`, `next` and `prev` run on
135
+ the optimistic path: they take no writer lock unless a read exhausts its bounded
136
+ retries, in which case it falls back to the writer-excluding path. The protocol is
137
+ blocking optimistic lock coupling, not lock-free. `rank`, `select`, `countRange`,
138
+ `keys`, `values` and `entries`, and the ordered reads of `SyncExpanseSet`, run with
139
+ writers excluded.
140
+
133
141
  ## License
134
142
 
135
143
  Dual-licensed under MIT and Apache-2.0.
package/index.d.ts CHANGED
@@ -484,6 +484,7 @@ export class SyncExpanseMap {
484
484
 
485
485
  size(): bigint;
486
486
  isEmpty(): boolean;
487
+ memUsed(): bigint;
487
488
  has(key: KeyInput): boolean;
488
489
  set(key: KeyInput, value: KeyInput): bigint | null;
489
490
  get(key: KeyInput): bigint | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orieg/expanse",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Clean-room, pure-Rust modern Judy arrays and digital tries with cache-line-tuned node geometries, inline value packing, slab arenas, and OCC concurrency for Node.js, Bun, and Deno.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,10 +12,10 @@
12
12
  "LICENSE-APACHE"
13
13
  ],
14
14
  "optionalDependencies": {
15
- "@orieg/expanse-linux-x64-gnu": "0.6.0",
16
- "@orieg/expanse-darwin-x64": "0.6.0",
17
- "@orieg/expanse-darwin-arm64": "0.6.0",
18
- "@orieg/expanse-win32-x64-msvc": "0.6.0"
15
+ "@orieg/expanse-linux-x64-gnu": "0.7.0",
16
+ "@orieg/expanse-darwin-x64": "0.7.0",
17
+ "@orieg/expanse-darwin-arm64": "0.7.0",
18
+ "@orieg/expanse-win32-x64-msvc": "0.7.0"
19
19
  },
20
20
  "scripts": {
21
21
  "test": "node test.js",