@daneren2005/shared-memory-objects 0.0.14 → 0.0.15
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/shared-memory-objects.js +353 -322
- package/dist/shared-memory-objects.js.map +1 -1
- package/dist/shared-memory-objects.umd.cjs +1 -1
- package/dist/shared-memory-objects.umd.cjs.map +1 -1
- package/dist/src/main.d.ts +1 -0
- package/dist/src/shared-pool.d.ts +3 -2
- package/dist/src/utils/float64-atomics.d.ts +6 -0
- package/package.json +1 -1
package/dist/src/main.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './utils/16-from-32-array';
|
|
|
14
14
|
export * from './utils/16-from-64-array';
|
|
15
15
|
export * from './utils/atomic-math';
|
|
16
16
|
export * from './utils/float32-atomics';
|
|
17
|
+
export * from './utils/float64-atomics';
|
|
17
18
|
export * from './utils/pointer';
|
|
18
19
|
export * from './lock/simple-lock';
|
|
19
20
|
export * from './lock/read-write-lock';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SharedAllocatedMemory } from './allocated-memory';
|
|
2
2
|
import { TypedArrayConstructor } from './interfaces/typed-array-constructor';
|
|
3
3
|
import { default as MemoryHeap } from './memory-heap';
|
|
4
|
-
export default class SharedPool<T extends Uint32Array | Int32Array | Float32Array = Uint32Array> implements Iterable<T> {
|
|
4
|
+
export default class SharedPool<T extends Uint32Array | Int32Array | Float32Array | Float64Array = Uint32Array> implements Iterable<T> {
|
|
5
5
|
static readonly ALLOCATE_COUNT: number;
|
|
6
6
|
private memory;
|
|
7
7
|
private firstBlock;
|
|
@@ -17,6 +17,7 @@ export default class SharedPool<T extends Uint32Array | Int32Array | Float32Arra
|
|
|
17
17
|
get dataLength(): number;
|
|
18
18
|
private set dataLength(value);
|
|
19
19
|
get bufferLength(): number;
|
|
20
|
+
get byteMultipler(): number;
|
|
20
21
|
constructor(memory: MemoryHeap, config?: SharedPoolConfig<T> | SharedPoolMemory);
|
|
21
22
|
at(index: number): T;
|
|
22
23
|
get(index: number, dataIndex?: number): number;
|
|
@@ -29,7 +30,7 @@ export default class SharedPool<T extends Uint32Array | Int32Array | Float32Arra
|
|
|
29
30
|
free(): void;
|
|
30
31
|
getSharedMemory(): SharedPoolMemory;
|
|
31
32
|
}
|
|
32
|
-
interface SharedPoolConfig<T extends Uint32Array | Int32Array | Float32Array> {
|
|
33
|
+
interface SharedPoolConfig<T extends Uint32Array | Int32Array | Float32Array | Float64Array> {
|
|
33
34
|
maxChunkSize?: number;
|
|
34
35
|
type?: TypedArrayConstructor<T>;
|
|
35
36
|
dataLength?: number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function loadFloat64(data: BigInt64Array | Float64Array, index: number): number;
|
|
2
|
+
export declare function storeFloat64(data: BigInt64Array | Float64Array, index: number, value: number): void;
|
|
3
|
+
export declare function convertInt64ToFloat64(value: bigint): number;
|
|
4
|
+
export declare function convertFloat64ToInt64(value: number): bigint;
|
|
5
|
+
export declare function exchangeFloat64(data: BigInt64Array | Float64Array, index: number, value: number): number;
|
|
6
|
+
export declare function compareExchangeFloat64(data: BigInt64Array | Float64Array, index: number, expectedValue: number, replacementValue: number): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daneren2005/shared-memory-objects",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"author": "daneren2005@gmail.com",
|
|
5
5
|
"description": "Creating objects with a SharedArrayBuffer",
|
|
6
6
|
"homepage": "https://github.com/daneren2005/shared-memory-objects#readme",
|