@irtio/runtime 4.5.1 → 4.6.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.
- package/dist/worker/index.d.ts +7 -0
- package/dist/worker/index.js +6 -1
- package/package.json +4 -4
package/dist/worker/index.d.ts
CHANGED
|
@@ -304,10 +304,17 @@ type FromWorker = {
|
|
|
304
304
|
* what cap it handed out to know how close the room is to it. Absent when the worker's
|
|
305
305
|
* V8 could not be sampled, which the supervisor must report as unread rather than as
|
|
306
306
|
* zero, for the same reason `ticks`/`overruns` are optional.
|
|
307
|
+
*
|
|
308
|
+
* bugs.md #146: `externalBytes` is the off-heap half — `ArrayBuffer` backing stores, WASM
|
|
309
|
+
* memory, `Buffer`s — which neither `usedBytes` nor the old-generation cap above it covers,
|
|
310
|
+
* and which is therefore the half a room can overshoot its whole budget with while every
|
|
311
|
+
* number the platform was reading stays small. Optional on the wire because an older worker
|
|
312
|
+
* does not send it, and because "V8 did not report it" is not "this room holds none".
|
|
307
313
|
*/
|
|
308
314
|
heap?: {
|
|
309
315
|
usedBytes: number;
|
|
310
316
|
limitBytes: number;
|
|
317
|
+
externalBytes?: number;
|
|
311
318
|
};
|
|
312
319
|
/**
|
|
313
320
|
* D56: `true` once any Rapier world in this worker process has stepped, which is the point
|
package/dist/worker/index.js
CHANGED
|
@@ -121,7 +121,12 @@ function heapSample() {
|
|
|
121
121
|
const s = getHeapStatistics();
|
|
122
122
|
if (!Number.isFinite(s.used_heap_size) || !Number.isFinite(s.heap_size_limit)) return void 0;
|
|
123
123
|
if (s.heap_size_limit <= 0) return void 0;
|
|
124
|
-
|
|
124
|
+
const external = s.external_memory;
|
|
125
|
+
return {
|
|
126
|
+
usedBytes: s.used_heap_size,
|
|
127
|
+
limitBytes: s.heap_size_limit,
|
|
128
|
+
...typeof external === "number" && Number.isFinite(external) && external >= 0 ? { externalBytes: external } : {}
|
|
129
|
+
};
|
|
125
130
|
} catch {
|
|
126
131
|
return void 0;
|
|
127
132
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irtio/runtime",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "irtio room runtime: RoomCore, worker_threads host, in-process test harness",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"@dimforge/rapier2d-compat": "0.20.0",
|
|
37
37
|
"@dimforge/rapier3d-compat": "0.20.0",
|
|
38
38
|
"matter-js": "0.20.0",
|
|
39
|
-
"@irtio/
|
|
40
|
-
"@irtio/
|
|
41
|
-
"@irtio/
|
|
39
|
+
"@irtio/schema": "^4.6.0",
|
|
40
|
+
"@irtio/server": "^4.6.0",
|
|
41
|
+
"@irtio/protocol": "^4.6.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/matter-js": "0.20.2"
|