@bnaya/objectbuffer
Advanced tools
Comparing version 0.0.0-8cc1a40 to 0.0.0-96df3bb
@@ -9,3 +9,3 @@ /** | ||
*/ /** */ | ||
export { createObjectBuffer, resizeObjectBuffer, getUnderlyingArrayBuffer, loadObjectBuffer, replaceUnderlyingArrayBuffer, sizeOf as unreliable_sizeOf, memoryStats, disposeWrapperObject, updateExternalArgs } from "./internal/api"; | ||
export { createObjectBuffer, resizeObjectBuffer, getUnderlyingArrayBuffer, loadObjectBuffer, replaceUnderlyingArrayBuffer, sizeOf as unreliable_sizeOf, memoryStats, disposeWrapperObject, updateExternalArgs, } from "./internal/api"; | ||
export { acquireLock, acquireLockWait, releaseLock } from "./internal/locks"; | ||
@@ -12,0 +12,0 @@ export declare type ExternalArgs = import("./internal/interfaces").ExternalArgsApi; |
@@ -9,3 +9,3 @@ /** | ||
*/ /** */ | ||
export { createObjectBuffer, resizeObjectBuffer, getUnderlyingArrayBuffer, loadObjectBuffer, replaceUnderlyingArrayBuffer, sizeOf as unreliable_sizeOf, memoryStats, disposeWrapperObject, updateExternalArgs } from "./internal/api"; | ||
export { createObjectBuffer, resizeObjectBuffer, getUnderlyingArrayBuffer, loadObjectBuffer, replaceUnderlyingArrayBuffer, sizeOf as unreliable_sizeOf, memoryStats, disposeWrapperObject, updateExternalArgs, } from "./internal/api"; | ||
export { acquireLock, acquireLockWait, releaseLock } from "./internal/locks"; | ||
@@ -12,0 +12,0 @@ export declare type ExternalArgs = import("./internal/interfaces").ExternalArgsApi; |
{ | ||
"name": "@bnaya/objectbuffer", | ||
"description": "Object-like api, backed by an array buffer", | ||
"version": "0.0.0-8cc1a40", | ||
"version": "0.0.0-96df3bb", | ||
"main": "dist/objectbuffer.cjs.js", | ||
@@ -40,35 +40,35 @@ "module": "dist/index.js", | ||
"@babel/cli": "^7.8.4", | ||
"@babel/core": "^7.8.4", | ||
"@babel/preset-env": "^7.8.4", | ||
"@babel/preset-typescript": "^7.8.3", | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.5", | ||
"@babel/preset-typescript": "^7.9.0", | ||
"@types/benchmark": "^1.0.31", | ||
"@types/jest": "^25.1.2", | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^12.12.21", | ||
"@typescript-eslint/eslint-plugin": "^2.19.0", | ||
"@typescript-eslint/parser": "^2.19.0", | ||
"babel-loader": "^8.0.6", | ||
"@typescript-eslint/eslint-plugin": "^2.27.0", | ||
"@typescript-eslint/parser": "^2.27.0", | ||
"babel-loader": "^8.1.0", | ||
"benchmark": "^2.1.4", | ||
"concurrently": "^5.1.0", | ||
"core-js": "^3.6.4", | ||
"core-js": "^3.6.5", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-config-prettier": "^6.10.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"gh-pages": "^2.2.0", | ||
"html-webpack-plugin": "^3.2.0", | ||
"husky": "^4.2.1", | ||
"jest": "^25.1.0", | ||
"prettier": "^1.19.1", | ||
"html-webpack-plugin": "^4.2.0", | ||
"husky": "^4.2.5", | ||
"jest": "^25.3.0", | ||
"prettier": "^2.0.4", | ||
"prettier-eslint": "^9.0.1", | ||
"rimraf": "^3.0.1", | ||
"rollup": "^1.31.0", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.4.0", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"typedoc": "^0.16.9", | ||
"typedoc-plugin-markdown": "^2.2.16", | ||
"typescript": "^3.7.5", | ||
"webpack": "^4.41.5", | ||
"webpack-cli": "^3.3.10", | ||
"typedoc": "^0.17.4", | ||
"typedoc-plugin-markdown": "^2.2.17", | ||
"typescript": "^3.8.3", | ||
"webpack": "^4.42.1", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3", | ||
"worker-loader": "^2.0.0", | ||
"yarn-deduplicate": "^1.1.1" | ||
"yarn-deduplicate": "^2.0.0" | ||
}, | ||
@@ -88,4 +88,4 @@ "husky": { | ||
"dependencies": { | ||
"@thi.ng/malloc": "^4.1.3" | ||
"@thi.ng/malloc": "^4.1.10" | ||
} | ||
} |
@@ -14,3 +14,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -17,0 +17,0 @@ |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -20,3 +20,3 @@ | ||
// 1/1 2000 | ||
myDate: new Date(946684800000) | ||
myDate: new Date(946684800000), | ||
}); | ||
@@ -23,0 +23,0 @@ |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -16,0 +16,0 @@ |
@@ -12,3 +12,3 @@ /* eslint-env jest */ | ||
textEncoder: new util.TextEncoder(), | ||
textDecoder: new util.TextDecoder() | ||
textDecoder: new util.TextDecoder(), | ||
}); | ||
@@ -120,3 +120,3 @@ | ||
[1, "a"], | ||
[2, "b"] | ||
[2, "b"], | ||
]); | ||
@@ -130,4 +130,4 @@ for (const [key] of nativeMap) { | ||
[1, "a"], | ||
[2, "b"] | ||
]) | ||
[2, "b"], | ||
]), | ||
}); | ||
@@ -156,3 +156,3 @@ for (const [key] of objectBuffer.foo) { | ||
expect(thisArgs.every(v => v === objectBuffer.foo)).toBe(true); | ||
expect(thisArgs.every((v) => v === objectBuffer.foo)).toBe(true); | ||
@@ -159,0 +159,0 @@ expect(dump).toMatchInlineSnapshot(` |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -20,3 +20,3 @@ | ||
arr: [1, 2, 3, 4], | ||
obj: { a: 1 } | ||
obj: { a: 1 }, | ||
}); | ||
@@ -35,3 +35,3 @@ | ||
arr: [1, 2, 3, 4], | ||
obj: { a: 1 } | ||
obj: { a: 1 }, | ||
}); | ||
@@ -38,0 +38,0 @@ |
@@ -12,3 +12,3 @@ /* eslint-env jest */ | ||
textEncoder: new util.TextEncoder(), | ||
textDecoder: new util.TextDecoder() | ||
textDecoder: new util.TextDecoder(), | ||
}); | ||
@@ -36,3 +36,3 @@ | ||
e: undefined, | ||
foo: { a: 1, b: true, c: false, d: null, e: undefined } | ||
foo: { a: 1, b: true, c: false, d: null, e: undefined }, | ||
}; | ||
@@ -39,0 +39,0 @@ |
@@ -9,7 +9,7 @@ /* eslint-env jest */ | ||
replaceUnderlyingArrayBuffer, | ||
memoryStats | ||
memoryStats, | ||
} from "../internal/api"; | ||
import { | ||
arrayBufferCopyTo, | ||
externalArgsApiToExternalArgsApi | ||
externalArgsApiToExternalArgsApi, | ||
} from "../internal/utils"; | ||
@@ -21,3 +21,3 @@ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -27,3 +27,3 @@ | ||
const objectBuffer = createObjectBuffer<any>(externalArgs, 512, { | ||
a: 1 | ||
a: 1, | ||
}); | ||
@@ -52,3 +52,3 @@ | ||
const objectBuffer = createObjectBuffer<any>(externalArgs, 1024, { | ||
obj1: { a: 1 } | ||
obj1: { a: 1 }, | ||
}); | ||
@@ -55,0 +55,0 @@ |
@@ -14,3 +14,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -26,3 +26,3 @@ | ||
const objectBuffer = createObjectBuffer<any>(externalArgs, 312, { | ||
value: "first value 123" | ||
value: "first value 123", | ||
}); | ||
@@ -29,0 +29,0 @@ const freeSpaceLeft = memoryStats(objectBuffer).available; |
@@ -12,3 +12,3 @@ /* eslint-env jest */ | ||
textEncoder: new util.TextEncoder(), | ||
textDecoder: new util.TextDecoder() | ||
textDecoder: new util.TextDecoder(), | ||
}); | ||
@@ -125,3 +125,3 @@ | ||
const objectBuffer = createObjectBuffer<any>(externalArgs, 1024, { | ||
foo: new Set(["a", "b"]) | ||
foo: new Set(["a", "b"]), | ||
}); | ||
@@ -150,3 +150,3 @@ for (const [key] of objectBuffer.foo) { | ||
expect(thisArgs.every(v => v === objectBuffer.foo)).toBe(true); | ||
expect(thisArgs.every((v) => v === objectBuffer.foo)).toBe(true); | ||
@@ -153,0 +153,0 @@ expect(dump).toMatchInlineSnapshot(` |
@@ -14,3 +14,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -17,0 +17,0 @@ |
@@ -12,3 +12,3 @@ import * as util from "util"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -18,3 +18,3 @@ | ||
const objectBuffer = createObjectBuffer<any>(externalArgs, 256, { | ||
foo: null | ||
foo: null, | ||
}); | ||
@@ -30,3 +30,3 @@ | ||
more: "than size", | ||
arr: [1, 2, 3] | ||
arr: [1, 2, 3], | ||
}; | ||
@@ -33,0 +33,0 @@ }).toThrowErrorMatchingInlineSnapshot(`"OutOfMemoryError"`); |
@@ -12,3 +12,3 @@ import * as util from "util"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -18,3 +18,3 @@ | ||
const objectBuffer = createObjectBuffer(externalArgs, 128, { | ||
num: 1 as number | bigint | ||
num: 1 as number | bigint, | ||
}); | ||
@@ -54,3 +54,3 @@ | ||
const objectBuffer = createObjectBuffer(externalArgs, 128, { | ||
nullContainer: null as null | undefined | ||
nullContainer: null as null | undefined, | ||
}); | ||
@@ -83,3 +83,3 @@ | ||
const objectBuffer = createObjectBuffer(externalArgs, 128, { | ||
booleanContainer: false | ||
booleanContainer: false, | ||
}); | ||
@@ -86,0 +86,0 @@ |
@@ -7,3 +7,3 @@ /* eslint-env jest */ | ||
getUnderlyingArrayBuffer, | ||
loadObjectBuffer | ||
loadObjectBuffer, | ||
} from "."; | ||
@@ -17,3 +17,3 @@ import { arrayBuffer2HexArray } from "./internal/testUtils"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -25,3 +25,3 @@ | ||
b: null, | ||
c: { t: 5 } | ||
c: { t: 5 }, | ||
}); | ||
@@ -45,3 +45,3 @@ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -51,3 +51,3 @@ test("getUnderlyingArrayBuffer simple", () => { | ||
b: null, | ||
c: { t: 5 } | ||
c: { t: 5 }, | ||
}); | ||
@@ -68,3 +68,3 @@ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -76,3 +76,3 @@ | ||
b: null, | ||
c: { t: 5 } | ||
c: { t: 5 }, | ||
}); | ||
@@ -79,0 +79,0 @@ |
@@ -20,3 +20,3 @@ /** | ||
disposeWrapperObject, | ||
updateExternalArgs | ||
updateExternalArgs, | ||
} from "./internal/api"; | ||
@@ -23,0 +23,0 @@ export { acquireLock, acquireLockWait, releaseLock } from "./internal/locks"; |
@@ -9,3 +9,3 @@ import { initializeArrayBuffer } from "./store"; | ||
getInternalAPI, | ||
isPrimitive | ||
isPrimitive, | ||
} from "./utils"; | ||
@@ -56,3 +56,3 @@ import { getCacheFor } from "./externalObjectsCache"; | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -67,3 +67,3 @@ | ||
float64: new Float64Array(arrayBuffer), | ||
bigUint64: new BigUint64Array(arrayBuffer) | ||
bigUint64: new BigUint64Array(arrayBuffer), | ||
}; | ||
@@ -136,3 +136,3 @@ | ||
start: MEM_POOL_START, | ||
skipInitialization: true | ||
skipInitialization: true, | ||
}); | ||
@@ -147,3 +147,3 @@ | ||
float64: new Float64Array(arrayBuffer), | ||
bigUint64: new BigUint64Array(arrayBuffer) | ||
bigUint64: new BigUint64Array(arrayBuffer), | ||
}; | ||
@@ -188,3 +188,3 @@ | ||
start: MEM_POOL_START, | ||
skipInitialization: true | ||
skipInitialization: true, | ||
}); | ||
@@ -199,3 +199,3 @@ | ||
float64: new Float64Array(newArrayBuffer), | ||
bigUint64: new BigUint64Array(newArrayBuffer) | ||
bigUint64: new BigUint64Array(newArrayBuffer), | ||
}; | ||
@@ -222,3 +222,3 @@ | ||
skipInitialization: true, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -225,0 +225,0 @@ |
@@ -9,3 +9,3 @@ /* eslint-env jest */ | ||
getFinalValueAtArrayIndex, | ||
setValueAtArrayIndex | ||
setValueAtArrayIndex, | ||
} from "./arrayHelpers"; | ||
@@ -21,3 +21,3 @@ import { ExternalArgs } from "./interfaces"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 0 | ||
arrayAdditionalAllocation: 0, | ||
}); | ||
@@ -58,3 +58,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -84,3 +84,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -110,3 +110,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -137,3 +137,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -140,0 +140,0 @@ |
import { | ||
readEntry, | ||
writeEntry, | ||
writeValueInPtrToPtrAndHandleMemory | ||
writeValueInPtrToPtrAndHandleMemory, | ||
} from "./store"; | ||
@@ -40,3 +40,3 @@ import { ArrayEntry, ExternalArgs, GlobalCarrier } from "./interfaces"; | ||
pointer, | ||
pointerToThePointer | ||
pointerToThePointer, | ||
}; | ||
@@ -135,3 +135,3 @@ } | ||
allocatedLength: metadata.allocatedLength, | ||
length: wishedLength | ||
length: wishedLength, | ||
}); | ||
@@ -158,3 +158,3 @@ } | ||
allocatedLength: metadata.allocatedLength, | ||
length: wishedLength | ||
length: wishedLength, | ||
}); | ||
@@ -195,3 +195,3 @@ } | ||
allocatedLength: newAllocatedLength, | ||
length: newLength | ||
length: newLength, | ||
}); | ||
@@ -208,12 +208,12 @@ } | ||
const pointersToValues = [...new Array(metadata.length).keys()] | ||
.map(index => metadata.value + index * Uint32Array.BYTES_PER_ELEMENT) | ||
.map((index) => metadata.value + index * Uint32Array.BYTES_PER_ELEMENT) | ||
.map( | ||
pointerToPointer => | ||
(pointerToPointer) => | ||
globalCarrier.uint32[pointerToPointer / Uint32Array.BYTES_PER_ELEMENT] | ||
); | ||
const sortMe = pointersToValues.map(pointer => { | ||
const sortMe = pointersToValues.map((pointer) => { | ||
return [ | ||
pointer, | ||
entryToFinalJavaScriptValue(externalArgs, globalCarrier, pointer) | ||
entryToFinalJavaScriptValue(externalArgs, globalCarrier, pointer), | ||
] as const; | ||
@@ -220,0 +220,0 @@ }); |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -16,0 +16,0 @@ |
@@ -23,3 +23,3 @@ import { appendEntry } from "./store"; | ||
arrayToSave.length + externalArgs.arrayAdditionalAllocation, | ||
length: arrayToSave.length | ||
length: arrayToSave.length, | ||
}; | ||
@@ -26,0 +26,0 @@ |
@@ -16,3 +16,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -26,3 +26,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -100,3 +100,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -151,3 +151,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -211,3 +211,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -293,3 +293,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -376,3 +376,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -445,3 +445,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -520,3 +520,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -595,3 +595,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -598,0 +598,0 @@ |
@@ -7,3 +7,3 @@ import { | ||
arrayGetPointersToValueInIndex, | ||
setValuePointerAtArrayIndex | ||
setValuePointerAtArrayIndex, | ||
} from "./arrayHelpers"; | ||
@@ -10,0 +10,0 @@ import { assertNonNull } from "./assertNonNull"; |
@@ -16,3 +16,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -27,3 +27,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -58,3 +58,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -82,3 +82,3 @@ const arrayToSave = ["a", "b", 1]; | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -121,3 +121,3 @@ const arrayToSave = ["a", "b", 1]; | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -221,3 +221,3 @@ const arrayToSave = ["a", "b", 1]; | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -261,3 +261,3 @@ const arrayToSave = ["a", "b", 1]; | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -299,7 +299,7 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
const arrayToSave = [2, 1, 3, 10, 6, 77].map(value => ({ | ||
value | ||
const arrayToSave = [2, 1, 3, 10, 6, 77].map((value) => ({ | ||
value, | ||
})); | ||
@@ -357,3 +357,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -398,3 +398,3 @@ | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -401,0 +401,0 @@ |
@@ -7,3 +7,3 @@ import { | ||
extendArrayIfNeeded, | ||
arrayReverse | ||
arrayReverse, | ||
} from "./arrayHelpers"; | ||
@@ -15,3 +15,3 @@ import { INTERNAL_API_SYMBOL } from "./symbols"; | ||
IllegalArrayIndexError, | ||
UnsupportedOperationError | ||
UnsupportedOperationError, | ||
} from "./exceptions"; | ||
@@ -173,3 +173,3 @@ import { allocationsTransaction } from "./allocationsTransaction"; | ||
index | ||
) | ||
), | ||
]; | ||
@@ -176,0 +176,0 @@ |
@@ -9,3 +9,3 @@ import { | ||
MapEntry, | ||
SetEntry | ||
SetEntry, | ||
} from "./interfaces"; | ||
@@ -12,0 +12,0 @@ import { incrementRefCount, decrementRefCount, readEntry } from "./store"; |
@@ -38,3 +38,3 @@ import { ExternalArgs, GlobalCarrier, DateEntry } from "./interfaces"; | ||
"toLocaleDateString", | ||
"toLocaleTimeString" | ||
"toLocaleTimeString", | ||
]; | ||
@@ -58,3 +58,3 @@ | ||
"setUTCMonth", | ||
"setUTCSeconds" | ||
"setUTCSeconds", | ||
// "setYear" | ||
@@ -118,3 +118,3 @@ ]; | ||
refsCount: this.entry.refsCount, | ||
value: this.dateObjectForReuse.getTime() | ||
value: this.dateObjectForReuse.getTime(), | ||
}); | ||
@@ -121,0 +121,0 @@ } |
@@ -11,3 +11,3 @@ import * as util from "util"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -19,3 +19,3 @@ | ||
array: [1], | ||
object: {} | ||
object: {}, | ||
}); | ||
@@ -35,3 +35,3 @@ | ||
Object.defineProperty(objectBuffer.date, "propy", { | ||
enumerable: true | ||
enumerable: true, | ||
}); | ||
@@ -59,3 +59,3 @@ }).toThrowErrorMatchingInlineSnapshot(`"UnsupportedOperationError"`); | ||
array: [1], | ||
object: {} | ||
object: {}, | ||
}); | ||
@@ -92,3 +92,3 @@ | ||
array: [1], | ||
object: {} | ||
object: {}, | ||
}); | ||
@@ -99,3 +99,3 @@ | ||
configurable: false, | ||
enumerable: false | ||
enumerable: false, | ||
}); | ||
@@ -102,0 +102,0 @@ }).toThrowErrorMatchingInlineSnapshot(`"UnsupportedOperationError"`); |
@@ -29,3 +29,3 @@ import { createKnownTypeGuard } from "./utils"; | ||
SET, | ||
DATE | ||
DATE, | ||
} | ||
@@ -37,5 +37,5 @@ | ||
ENTRY_TYPE.BIGINT_NEGATIVE, | ||
ENTRY_TYPE.STRING | ||
ENTRY_TYPE.STRING, | ||
] as const; | ||
export const isPrimitiveEntryType = createKnownTypeGuard(PRIMITIVE_TYPES); |
@@ -15,3 +15,3 @@ import { ExternalArgs, GlobalCarrier } from "./interfaces"; | ||
TRUE_KNOWN_ADDRESS, | ||
FALSE_KNOWN_ADDRESS | ||
FALSE_KNOWN_ADDRESS, | ||
} from "./consts"; | ||
@@ -27,3 +27,3 @@ | ||
[ENTRY_TYPE.MAP]: createMapWrapper, | ||
[ENTRY_TYPE.SET]: createSetWrapper | ||
[ENTRY_TYPE.SET]: createSetWrapper, | ||
} as const; | ||
@@ -65,3 +65,3 @@ | ||
) { | ||
const cache = getCacheFor(carrier, key => { | ||
const cache = getCacheFor(carrier, (key) => { | ||
finalizer(key, carrier, externalArgs); | ||
@@ -68,0 +68,0 @@ }); |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -31,3 +31,3 @@ | ||
nestedObject: { a: 1, b: null, c: "string", bigint: BigInt("100") }, | ||
arr: [new Date(0), "somestring", { a: "6", h: null }] | ||
arr: [new Date(0), "somestring", { a: "6", h: null }], | ||
}); | ||
@@ -122,3 +122,3 @@ | ||
nestedObject: { a: 1, b: null, c: "string", bigint: BigInt("100") }, | ||
arr: [new Date(0), "somestring", { a: "6", h: null }] | ||
arr: [new Date(0), "somestring", { a: "6", h: null }], | ||
}); | ||
@@ -143,3 +143,3 @@ | ||
linkedAddresses.leafAddresses.forEach(address => { | ||
linkedAddresses.leafAddresses.forEach((address) => { | ||
pool.free(address); | ||
@@ -146,0 +146,0 @@ }); |
@@ -6,3 +6,3 @@ /* eslint-env jest */ | ||
recordAllocations, | ||
makeCarrier | ||
makeCarrier, | ||
} from "../testUtils"; | ||
@@ -17,3 +17,3 @@ import { | ||
hashMapDelete, | ||
hashMapGetPointersToFree | ||
hashMapGetPointersToFree, | ||
} from "./hashmap"; | ||
@@ -28,3 +28,3 @@ import { GlobalCarrier, StringEntry } from "../interfaces"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -157,3 +157,3 @@ | ||
.map((i): number => i + "a".charCodeAt(0)) | ||
.map(n => String.fromCharCode(n)); | ||
.map((n) => String.fromCharCode(n)); | ||
@@ -188,3 +188,3 @@ const inserts: number[] = []; | ||
expect( | ||
values.map(v => (readEntry(carrier, v.keyPointer) as StringEntry).value) | ||
values.map((v) => (readEntry(carrier, v.keyPointer) as StringEntry).value) | ||
).toMatchInlineSnapshot(` | ||
@@ -231,3 +231,3 @@ Array [ | ||
.map((i): number => i + "a".charCodeAt(0)) | ||
.map(n => String.fromCharCode(n)); | ||
.map((n) => String.fromCharCode(n)); | ||
@@ -292,3 +292,3 @@ for (const [index, useThatAsKey] of input.entries()) { | ||
.map((i): number => i + "a".charCodeAt(0)) | ||
.map(n => String.fromCharCode(n)); | ||
.map((n) => String.fromCharCode(n)); | ||
const inputCopy = input.slice(); | ||
@@ -369,3 +369,3 @@ | ||
r.pointersToValuePointers | ||
.map(v => | ||
.map((v) => | ||
String.fromCharCode(carrier.uint32[v / Uint32Array.BYTES_PER_ELEMENT]) | ||
@@ -372,0 +372,0 @@ ) |
@@ -6,3 +6,3 @@ import { MAP_MACHINE, NODE_MACHINE } from "./memoryLayout"; | ||
NumberEntry, | ||
StringEntry | ||
StringEntry, | ||
} from "../interfaces"; | ||
@@ -12,3 +12,3 @@ import { | ||
hashCodeExternalValue, | ||
getKeyStartLength | ||
getKeyStartLength, | ||
} from "./hashmapUtils"; | ||
@@ -20,3 +20,3 @@ import { primitiveValueToEntry } from "../utils"; | ||
readEntry, | ||
compareStringOrNumberEntriesInPlace | ||
compareStringOrNumberEntriesInPlace, | ||
} from "../store"; | ||
@@ -30,3 +30,3 @@ import { ENTRY_TYPE } from "../entry-types"; | ||
linkedListGetValue, | ||
linkedListGetPointersToFree | ||
linkedListGetPointersToFree, | ||
} from "../linkedList/linkedList"; | ||
@@ -321,3 +321,3 @@ | ||
valuePointer: operator.pointerTo("VALUE_POINTER"), | ||
keyPointer: operator.get("KEY_POINTER") | ||
keyPointer: operator.get("KEY_POINTER"), | ||
}; | ||
@@ -357,3 +357,3 @@ } | ||
pointers, | ||
pointersToValuePointers | ||
pointersToValuePointers, | ||
}; | ||
@@ -360,0 +360,0 @@ } |
@@ -67,3 +67,3 @@ import { ENTRY_TYPE } from "../entry-types"; | ||
start: keyPointer + 1, | ||
length: Float64Array.BYTES_PER_ELEMENT | ||
length: Float64Array.BYTES_PER_ELEMENT, | ||
}; | ||
@@ -73,5 +73,5 @@ } else { | ||
start: keyPointer + 1 + 2 + 2, | ||
length: carrier.uint16[(keyPointer + 1) / Uint16Array.BYTES_PER_ELEMENT] | ||
length: carrier.uint16[(keyPointer + 1) / Uint16Array.BYTES_PER_ELEMENT], | ||
}; | ||
} | ||
} |
@@ -9,3 +9,3 @@ import { createMemoryMachine } from "../memoryMachinery"; | ||
CAPACITY: Uint8Array, | ||
USED_CAPACITY: Uint8Array | ||
USED_CAPACITY: Uint8Array, | ||
}); | ||
@@ -17,3 +17,3 @@ | ||
KEY_POINTER: Uint32Array, | ||
LINKED_LIST_ITEM_POINTER: Uint32Array | ||
LINKED_LIST_ITEM_POINTER: Uint32Array, | ||
}); | ||
@@ -20,0 +20,0 @@ |
@@ -6,3 +6,3 @@ /* eslint-env jest */ | ||
recordAllocations, | ||
makeCarrier | ||
makeCarrier, | ||
} from "../testUtils"; | ||
@@ -20,3 +20,3 @@ | ||
linkedListGetValue, | ||
linkedListGetPointersToFree | ||
linkedListGetPointersToFree, | ||
// LINKED_LIST_ITEM_MACHINE | ||
@@ -104,3 +104,3 @@ } from "./linkedList"; | ||
linkedListItemInsert(carrier, linkedListPointer, 5), | ||
linkedListItemInsert(carrier, linkedListPointer, 4) | ||
linkedListItemInsert(carrier, linkedListPointer, 4), | ||
]; | ||
@@ -132,3 +132,3 @@ | ||
itemsPointers.forEach(p => linkedListItemRemove(carrier, p)); | ||
itemsPointers.forEach((p) => linkedListItemRemove(carrier, p)); | ||
@@ -148,3 +148,3 @@ expect(carrier.allocator.stats().available).toMatchInlineSnapshot(`184`); | ||
linkedListItemInsert(carrier, linkedListPointer, 5), | ||
linkedListItemInsert(carrier, linkedListPointer, 4) | ||
linkedListItemInsert(carrier, linkedListPointer, 4), | ||
]; | ||
@@ -183,3 +183,3 @@ | ||
itemsPointers.forEach(p => linkedListItemRemove(carrier, p)); | ||
itemsPointers.forEach((p) => linkedListItemRemove(carrier, p)); | ||
@@ -200,3 +200,3 @@ expect(carrier.allocator.stats().available).toMatchInlineSnapshot(`184`); | ||
linkedListItemInsert(carrier, linkedListPointer, 5), | ||
linkedListItemInsert(carrier, linkedListPointer, 4) | ||
linkedListItemInsert(carrier, linkedListPointer, 4), | ||
]; | ||
@@ -242,3 +242,3 @@ | ||
itemsPointers.forEach(p => linkedListItemRemove(carrier, p)); | ||
itemsPointers.forEach((p) => linkedListItemRemove(carrier, p)); | ||
@@ -256,3 +256,3 @@ expect(carrier.allocator.stats().available).toMatchInlineSnapshot(`184`); | ||
linkedListItemInsert(carrier, linkedListPointer, 7), | ||
linkedListItemInsert(carrier, linkedListPointer, 6) | ||
linkedListItemInsert(carrier, linkedListPointer, 6), | ||
]; | ||
@@ -302,3 +302,3 @@ | ||
itemsPointers.forEach(p => linkedListItemRemove(carrier, p)); | ||
itemsPointers.forEach((p) => linkedListItemRemove(carrier, p)); | ||
@@ -305,0 +305,0 @@ const iteratorPointerToFree = 0; |
@@ -21,3 +21,3 @@ import { createMemoryMachine } from "../memoryMachinery"; | ||
NEXT_POINTER: Uint32Array, | ||
VALUE: Uint32Array | ||
VALUE: Uint32Array, | ||
}); | ||
@@ -31,3 +31,3 @@ | ||
END_POINTER: Uint32Array, | ||
START_POINTER: Uint32Array | ||
START_POINTER: Uint32Array, | ||
}); | ||
@@ -202,4 +202,4 @@ export type LinkedListMachineType = ReturnType< | ||
pointers, | ||
valuePointers | ||
valuePointers, | ||
}; | ||
} |
@@ -5,3 +5,3 @@ import { | ||
MapEntry, | ||
InternalAPI | ||
InternalAPI, | ||
} from "./interfaces"; | ||
@@ -12,3 +12,3 @@ import { | ||
objectSet, | ||
mapOrSetClear | ||
mapOrSetClear, | ||
} from "./objectWrapperHelpers"; | ||
@@ -24,3 +24,3 @@ | ||
hashMapNodePointerToKeyValue, | ||
hashmapNodesPointerIterator | ||
hashmapNodesPointerIterator, | ||
} from "./hashmap/hashmap"; | ||
@@ -73,3 +73,3 @@ import { entryToFinalJavaScriptValue } from "./entryToFinalJavaScriptValue"; | ||
this.carrier.uint32[valuePointer / Uint32Array.BYTES_PER_ELEMENT] | ||
) | ||
), | ||
]; | ||
@@ -76,0 +76,0 @@ } |
@@ -5,3 +5,3 @@ /* eslint-env jest */ | ||
createMemoryOperator, | ||
_buildMemoryLayout | ||
_buildMemoryLayout, | ||
} from "./memoryMachinery"; | ||
@@ -15,3 +15,3 @@ import { arrayBuffer2HexArray, makeCarrier } from "./testUtils"; | ||
Uint32: Uint32Array, | ||
Uint8: Uint8Array | ||
Uint8: Uint8Array, | ||
}; | ||
@@ -41,7 +41,7 @@ | ||
.filter(([key]) => key !== "SIZE_OF") | ||
.map(entry => [ | ||
.map((entry) => [ | ||
entry[0], | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore | ||
// @ts-ignore | ||
entry[1].type | ||
entry[1].type, | ||
]) | ||
@@ -54,3 +54,3 @@ ).toEqual(Object.entries(input)); | ||
POINTER_TO_NODE: Uint32Array, | ||
LENGTH_OF_KEY: Uint32Array | ||
LENGTH_OF_KEY: Uint32Array, | ||
}); | ||
@@ -194,3 +194,3 @@ | ||
POINTER_TO_NODE: Uint32Array, | ||
LENGTH_OF_KEY: Uint32Array | ||
LENGTH_OF_KEY: Uint32Array, | ||
}); | ||
@@ -215,3 +215,3 @@ | ||
NODE_KEY_POINTER: Uint32Array.BYTES_PER_ELEMENT, | ||
NODE_KEY_LENGTH: Uint16Array.BYTES_PER_ELEMENT | ||
NODE_KEY_LENGTH: Uint16Array.BYTES_PER_ELEMENT, | ||
}); | ||
@@ -218,0 +218,0 @@ |
@@ -7,3 +7,3 @@ import { GlobalCarrier } from "./interfaces"; | ||
// BigUint64Array, | ||
Uint16Array | ||
Uint16Array, | ||
] as const; | ||
@@ -38,3 +38,3 @@ | ||
// [BigUint64Array, dataViewInstance.getBigUint64, dataViewInstance.setBigUint64], | ||
[Uint16Array, "uint16"] | ||
[Uint16Array, "uint16"], | ||
] as const; | ||
@@ -49,3 +49,3 @@ | ||
const READ_WRITE_MAP_V2 = new Map(READ_WRITE_MAPS_V2.map(e => [e[0], e[1]])); | ||
const READ_WRITE_MAP_V2 = new Map(READ_WRITE_MAPS_V2.map((e) => [e[0], e[1]])); | ||
@@ -93,3 +93,3 @@ export interface MemoryOperator<T extends string> { | ||
}, | ||
size: memoryMap.SIZE_OF | ||
size: memoryMap.SIZE_OF, | ||
}; | ||
@@ -117,4 +117,4 @@ } | ||
(oldEntries[index - 1][1] as any).BYTES_PER_ELEMENT, | ||
type: type as any | ||
} | ||
type: type as any, | ||
}, | ||
]); | ||
@@ -128,3 +128,3 @@ } | ||
(oldEntries[newObjectEntries.length - 1][1] as TypedArrayCtor) | ||
.BYTES_PER_ELEMENT | ||
.BYTES_PER_ELEMENT, | ||
]); | ||
@@ -145,3 +145,3 @@ | ||
address: number | ||
) => MemoryOperator<T> | ||
) => MemoryOperator<T>, | ||
}; | ||
@@ -162,3 +162,3 @@ } | ||
key, | ||
newObjectEntries[index - 1][1] + oldEntries[index - 1][1] | ||
newObjectEntries[index - 1][1] + oldEntries[index - 1][1], | ||
]); | ||
@@ -171,3 +171,3 @@ } | ||
newObjectEntries[newObjectEntries.length - 1][1] + | ||
oldEntries[newObjectEntries.length - 1][1] | ||
oldEntries[newObjectEntries.length - 1][1], | ||
]); | ||
@@ -174,0 +174,0 @@ |
@@ -14,3 +14,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -17,0 +17,0 @@ |
@@ -12,3 +12,3 @@ /* eslint-env jest */ | ||
textEncoder: new util.TextEncoder(), | ||
textDecoder: new util.TextDecoder() | ||
textDecoder: new util.TextDecoder(), | ||
}); | ||
@@ -31,4 +31,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -35,0 +35,0 @@ |
@@ -8,3 +8,3 @@ import { appendEntry } from "./store"; | ||
MapEntry, | ||
SetEntry | ||
SetEntry, | ||
} from "./interfaces"; | ||
@@ -51,3 +51,3 @@ import { saveValue } from "./saveValue"; | ||
refsCount: 1, | ||
value: hashMapPointer | ||
value: hashMapPointer, | ||
}; | ||
@@ -93,3 +93,3 @@ | ||
refsCount: 1, | ||
value: hashMapPointer | ||
value: hashMapPointer, | ||
}; | ||
@@ -127,3 +127,3 @@ | ||
refsCount: 1, | ||
value: hashMapPointer | ||
value: hashMapPointer, | ||
}; | ||
@@ -130,0 +130,0 @@ |
@@ -13,3 +13,3 @@ /* eslint-env jest */ | ||
textEncoder: new util.TextEncoder(), | ||
textDecoder: new util.TextDecoder() | ||
textDecoder: new util.TextDecoder(), | ||
}); | ||
@@ -29,4 +29,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -73,4 +73,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -104,4 +104,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -146,4 +146,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -189,4 +189,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -193,0 +193,0 @@ |
@@ -6,3 +6,3 @@ import { ObjectEntry, ExternalArgs, GlobalCarrier } from "./interfaces"; | ||
objectGet, | ||
objectSet | ||
objectSet, | ||
} from "./objectWrapperHelpers"; | ||
@@ -13,3 +13,3 @@ | ||
IllegalObjectPropConfigError, | ||
UnsupportedOperationError | ||
UnsupportedOperationError, | ||
} from "./exceptions"; | ||
@@ -53,3 +53,3 @@ import { allocationsTransaction } from "./allocationsTransaction"; | ||
return gotEntries.map(e => e.key); | ||
return gotEntries.map((e) => e.key); | ||
} | ||
@@ -63,3 +63,3 @@ | ||
return gotEntries.map(e => e.key); | ||
return gotEntries.map((e) => e.key); | ||
} | ||
@@ -66,0 +66,0 @@ |
@@ -8,3 +8,3 @@ /* eslint-env jest */ | ||
getObjectPropertiesEntries, | ||
deleteObjectPropertyEntryByKey | ||
deleteObjectPropertyEntryByKey, | ||
} from "./objectWrapperHelpers"; | ||
@@ -19,3 +19,3 @@ import { externalArgsApiToExternalArgsApi } from "./utils"; | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -34,4 +34,4 @@ | ||
nestedObject: { | ||
nestedProp: 7 | ||
} | ||
nestedProp: 7, | ||
}, | ||
}; | ||
@@ -81,3 +81,3 @@ | ||
c: undefined, | ||
d: null | ||
d: null, | ||
}; | ||
@@ -131,3 +131,3 @@ | ||
c: undefined, | ||
d: null | ||
d: null, | ||
}; | ||
@@ -180,3 +180,3 @@ | ||
d: null, | ||
e: 66 | ||
e: 66, | ||
}; | ||
@@ -183,0 +183,0 @@ |
@@ -7,3 +7,3 @@ import { | ||
MapEntry, | ||
SetEntry | ||
SetEntry, | ||
} from "./interfaces"; | ||
@@ -15,3 +15,3 @@ import { | ||
decrementRefCount, | ||
writeEntry | ||
writeEntry, | ||
} from "./store"; | ||
@@ -25,3 +25,3 @@ import { entryToFinalJavaScriptValue } from "./entryToFinalJavaScriptValue"; | ||
hashMapValueLookup, | ||
createHashMap | ||
createHashMap, | ||
} from "./hashmap/hashmap"; | ||
@@ -79,3 +79,3 @@ import { getObjectOrMapOrSetAddresses } from "./getAllLinkedAddresses"; | ||
carrier.uint32[valuePointer / Uint32Array.BYTES_PER_ELEMENT], | ||
key: keyEntry.value | ||
key: keyEntry.value, | ||
}); | ||
@@ -82,0 +82,0 @@ } |
import { | ||
primitiveValueToEntry, | ||
isPrimitive, | ||
getOurPointerIfApplicable | ||
getOurPointerIfApplicable, | ||
} from "./utils"; | ||
@@ -15,3 +15,3 @@ import { appendEntry } from "./store"; | ||
TRUE_KNOWN_ADDRESS, | ||
FALSE_KNOWN_ADDRESS | ||
FALSE_KNOWN_ADDRESS, | ||
} from "./consts"; | ||
@@ -61,3 +61,3 @@ | ||
refsCount: 1, | ||
value: value.getTime() | ||
value: value.getTime(), | ||
}); | ||
@@ -64,0 +64,0 @@ } else if (value instanceof Map) { |
@@ -5,3 +5,3 @@ import { | ||
MapEntry, | ||
InternalAPI | ||
InternalAPI, | ||
} from "./interfaces"; | ||
@@ -11,3 +11,3 @@ import { | ||
objectSet, | ||
mapOrSetClear | ||
mapOrSetClear, | ||
} from "./objectWrapperHelpers"; | ||
@@ -23,3 +23,3 @@ | ||
hashMapNodePointerToKeyValue, | ||
hashmapNodesPointerIterator | ||
hashmapNodesPointerIterator, | ||
} from "./hashmap/hashmap"; | ||
@@ -26,0 +26,0 @@ import { entryToFinalJavaScriptValue } from "./entryToFinalJavaScriptValue"; |
@@ -12,3 +12,3 @@ /* eslint-env jest */ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -28,3 +28,3 @@ | ||
calcedSize, | ||
realSize: beforeSave - afterSave | ||
realSize: beforeSave - afterSave, | ||
}; | ||
@@ -31,0 +31,0 @@ } |
@@ -5,3 +5,3 @@ import { | ||
ArrayEntry, | ||
ObjectEntry | ||
ObjectEntry, | ||
} from "./interfaces"; | ||
@@ -12,3 +12,3 @@ import { | ||
primitiveValueToEntry, | ||
align | ||
align, | ||
} from "./utils"; | ||
@@ -18,3 +18,3 @@ import { ENTRY_TYPE } from "./entry-types"; | ||
LINKED_LIST_MACHINE, | ||
LINKED_LIST_ITEM_MACHINE | ||
LINKED_LIST_ITEM_MACHINE, | ||
} from "./linkedList/linkedList"; | ||
@@ -63,3 +63,3 @@ import { MAP_MACHINE, NODE_MACHINE } from "./hashmap/memoryLayout"; | ||
arrayToSave.length + externalArgs.arrayAdditionalAllocation, | ||
length: arrayToSave.length | ||
length: arrayToSave.length, | ||
}; | ||
@@ -79,3 +79,3 @@ | ||
memoryAllocated, | ||
numberOfAllocations | ||
numberOfAllocations, | ||
}; | ||
@@ -110,3 +110,3 @@ } | ||
refsCount: 0, | ||
value: 0 | ||
value: 0, | ||
}; | ||
@@ -119,3 +119,3 @@ | ||
memoryAllocated, | ||
numberOfAllocations | ||
numberOfAllocations, | ||
}; | ||
@@ -136,3 +136,3 @@ } | ||
memoryAllocated: 0, | ||
numberOfAllocations: 0 | ||
numberOfAllocations: 0, | ||
}; | ||
@@ -146,3 +146,3 @@ } | ||
memoryAllocated: align(sizeOfEntry(entry)), | ||
numberOfAllocations: 1 | ||
numberOfAllocations: 1, | ||
}; | ||
@@ -157,6 +157,6 @@ } else if (Array.isArray(value)) { | ||
refsCount: 0, | ||
value: value.getTime() | ||
value: value.getTime(), | ||
}) | ||
), | ||
numberOfAllocations: 1 | ||
numberOfAllocations: 1, | ||
}; | ||
@@ -197,3 +197,3 @@ } else if (typeof value === "object") { | ||
const hashMapKeysSize = keysArray | ||
.map(k => sizeOfEntry(primitiveValueToEntry(k))) | ||
.map((k) => sizeOfEntry(primitiveValueToEntry(k))) | ||
.reduce((p, c) => { | ||
@@ -215,4 +215,4 @@ return p + align(c); | ||
hashMapNodesAllocationsSize + | ||
hashMapKeysSize | ||
hashMapKeysSize, | ||
}; | ||
} |
@@ -7,3 +7,3 @@ /* eslint-env jest */ | ||
readEntry, | ||
appendEntry | ||
appendEntry, | ||
} from "./store"; | ||
@@ -56,3 +56,3 @@ import { ENTRY_TYPE } from "./entry-types"; | ||
type: ENTRY_TYPE.NUMBER, | ||
value: Number.MAX_VALUE | ||
value: Number.MAX_VALUE, | ||
}); | ||
@@ -89,3 +89,3 @@ | ||
type: ENTRY_TYPE.NUMBER, | ||
value: Number.MIN_VALUE | ||
value: Number.MIN_VALUE, | ||
}); | ||
@@ -124,3 +124,3 @@ | ||
value: "aא弟", | ||
allocatedBytes: 6 | ||
allocatedBytes: 6, | ||
}); | ||
@@ -159,3 +159,3 @@ | ||
textDecoder: new util.TextDecoder(), | ||
arrayAdditionalAllocation: 20 | ||
arrayAdditionalAllocation: 20, | ||
}); | ||
@@ -169,3 +169,3 @@ | ||
type: ENTRY_TYPE.NUMBER, | ||
value: Number.MAX_VALUE | ||
value: Number.MAX_VALUE, | ||
}); | ||
@@ -191,3 +191,3 @@ | ||
type: ENTRY_TYPE.NUMBER, | ||
value: Number.MIN_VALUE | ||
value: Number.MIN_VALUE, | ||
}); | ||
@@ -212,3 +212,3 @@ | ||
value: "aא弟", | ||
allocatedBytes: 6 | ||
allocatedBytes: 6, | ||
}); | ||
@@ -233,3 +233,3 @@ | ||
type: ENTRY_TYPE.BIGINT_POSITIVE, | ||
value: BigInt("0b0" + "1".repeat(63)) | ||
value: BigInt("0b0" + "1".repeat(63)), | ||
}); | ||
@@ -253,3 +253,3 @@ | ||
type: ENTRY_TYPE.BIGINT_POSITIVE, | ||
value: BigInt("0b" + "1".repeat(64)) | ||
value: BigInt("0b" + "1".repeat(64)), | ||
}); | ||
@@ -272,3 +272,3 @@ | ||
type: ENTRY_TYPE.BIGINT_POSITIVE, | ||
value: BigInt("0b" + "1".repeat(64)) | ||
value: BigInt("0b" + "1".repeat(64)), | ||
}); | ||
@@ -290,3 +290,3 @@ | ||
type: ENTRY_TYPE.BIGINT_NEGATIVE, | ||
value: -BigInt("0b" + "1".repeat(64)) | ||
value: -BigInt("0b" + "1".repeat(64)), | ||
}); | ||
@@ -309,3 +309,3 @@ | ||
type: ENTRY_TYPE.BIGINT_POSITIVE, | ||
value: BigInt("0b" + "1".repeat(65)) | ||
value: BigInt("0b" + "1".repeat(65)), | ||
}); | ||
@@ -323,3 +323,3 @@ }).toThrowErrorMatchingInlineSnapshot(`"BigInt64OverflowError"`); | ||
refsCount: 0, | ||
value: 10 | ||
value: 10, | ||
}; | ||
@@ -351,3 +351,3 @@ | ||
value: "im a string", | ||
allocatedBytes: 11 | ||
allocatedBytes: 11, | ||
}); | ||
@@ -354,0 +354,0 @@ |
@@ -6,3 +6,3 @@ import { ENTRY_TYPE, isPrimitiveEntryType } from "./entry-types"; | ||
primitiveValueToEntry, | ||
isKnownAddressValuePointer | ||
isKnownAddressValuePointer, | ||
} from "./utils"; | ||
@@ -13,3 +13,3 @@ import { ExternalArgs } from "./interfaces"; | ||
INITIAL_ENTRY_POINTER_TO_POINTER, | ||
INITIAL_ENTRY_POINTER_VALUE | ||
INITIAL_ENTRY_POINTER_VALUE, | ||
} from "./consts"; | ||
@@ -134,3 +134,3 @@ import { saveValue } from "./saveValue"; | ||
writtenBytes, | ||
allocatedBytes: entry.allocatedBytes | ||
allocatedBytes: entry.allocatedBytes, | ||
}, | ||
@@ -218,3 +218,3 @@ true | ||
type: entryType, | ||
value: undefined as any | ||
value: undefined as any, | ||
}; | ||
@@ -377,3 +377,3 @@ | ||
existingEntryPointer, | ||
existingValueEntry | ||
existingValueEntry, | ||
}; | ||
@@ -392,3 +392,3 @@ } | ||
existingEntryPointer = 0, | ||
referencedPointers = [] | ||
referencedPointers = [], | ||
} = writeValueInPtrToPtr(externalArgs, carrier, ptrToPtr, value) || {}; | ||
@@ -395,0 +395,0 @@ |
@@ -19,4 +19,4 @@ /* eslint-env jest */ | ||
`請教「署」在文中的含義。 文句中「署」是什么意思?「使直言署」,及下文的「署帛宛然」a`, | ||
125 | ||
] | ||
125, | ||
], | ||
]; | ||
@@ -23,0 +23,0 @@ |
@@ -21,4 +21,4 @@ /* eslint-env jest */ | ||
`請教「署」在文中的含義。 文句中「署」是什么意思?「使直言署」,及下文的「署帛宛然」`, | ||
124 | ||
] | ||
124, | ||
], | ||
]; | ||
@@ -25,0 +25,0 @@ |
@@ -17,3 +17,3 @@ export function arrayBuffer2HexArray( | ||
export function wait(time: number) { | ||
return new Promise(res => { | ||
return new Promise((res) => { | ||
// eslint-disable-next-line no-undef | ||
@@ -102,3 +102,3 @@ setTimeout(res, time); | ||
buf: arrayBuffer, | ||
start: MEM_POOL_START | ||
start: MEM_POOL_START, | ||
}); | ||
@@ -113,3 +113,3 @@ | ||
float64: new Float64Array(arrayBuffer), | ||
bigUint64: new BigUint64Array(arrayBuffer) | ||
bigUint64: new BigUint64Array(arrayBuffer), | ||
}; | ||
@@ -116,0 +116,0 @@ |
@@ -6,3 +6,3 @@ import { | ||
InternalAPI, | ||
ExternalArgsApi | ||
ExternalArgsApi, | ||
} from "./interfaces"; | ||
@@ -15,3 +15,3 @@ import { ENTRY_TYPE } from "./entry-types"; | ||
TRUE_KNOWN_ADDRESS, | ||
FALSE_KNOWN_ADDRESS | ||
FALSE_KNOWN_ADDRESS, | ||
} from "./consts"; | ||
@@ -25,3 +25,3 @@ import { IMemPool } from "@thi.ng/malloc"; | ||
"boolean", | ||
"undefined" | ||
"undefined", | ||
] as const; | ||
@@ -46,3 +46,3 @@ | ||
value, | ||
allocatedBytes: strByteLength(value) | ||
allocatedBytes: strByteLength(value), | ||
}; | ||
@@ -54,3 +54,3 @@ } | ||
type: ENTRY_TYPE.NUMBER, | ||
value | ||
value, | ||
}; | ||
@@ -65,3 +65,3 @@ } | ||
: ENTRY_TYPE.BIGINT_NEGATIVE, | ||
value | ||
value, | ||
}; | ||
@@ -118,3 +118,3 @@ } | ||
? p.arrayAdditionalAllocation | ||
: 0 | ||
: 0, | ||
}; | ||
@@ -121,0 +121,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
803637
20848
Updated@thi.ng/malloc@^4.1.10