@daneren2005/shared-memory-objects 0.0.12 → 0.0.14
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/README.md +25 -25
- package/dist/shared-memory-objects.js +452 -274
- 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 +3 -1
- package/dist/src/shared-pool.d.ts +1 -0
- package/dist/src/utils/atomic-math.d.ts +4 -0
- package/dist/src/utils/float32-atomics.d.ts +4 -3
- package/package.json +1 -1
package/dist/src/main.d.ts
CHANGED
|
@@ -7,12 +7,14 @@ import { default as SharedPointerList } from './shared-pointer-list';
|
|
|
7
7
|
import { default as SharedString } from './shared-string';
|
|
8
8
|
import { default as SharedVector, SharedVectorMemory } from './shared-vector';
|
|
9
9
|
import { default as CachedItemList, CachedListConfig } from './cached-item-list';
|
|
10
|
+
import { default as SharedPool, SharedPoolMemory, SharedPoolConfig } from './shared-pool';
|
|
10
11
|
export * from './interfaces/typed-array';
|
|
11
12
|
export * from './interfaces/typed-array-constructor';
|
|
12
13
|
export * from './utils/16-from-32-array';
|
|
13
14
|
export * from './utils/16-from-64-array';
|
|
15
|
+
export * from './utils/atomic-math';
|
|
14
16
|
export * from './utils/float32-atomics';
|
|
15
17
|
export * from './utils/pointer';
|
|
16
18
|
export * from './lock/simple-lock';
|
|
17
19
|
export * from './lock/read-write-lock';
|
|
18
|
-
export { AllocatedMemory, type SharedAllocatedMemory, MemoryBuffer, MemoryHeap, type MemoryHeapMemory, type GrowBufferData, SharedList, type SharedListMemory, SharedMap, type SharedMapMemory, SharedPointerList, SharedString, SharedVector, type SharedVectorMemory, CachedItemList, type CachedListConfig };
|
|
20
|
+
export { AllocatedMemory, type SharedAllocatedMemory, MemoryBuffer, MemoryHeap, type MemoryHeapMemory, type GrowBufferData, SharedList, type SharedListMemory, SharedMap, type SharedMapMemory, SharedPointerList, SharedString, SharedVector, type SharedVectorMemory, SharedPool, type SharedPoolMemory, type SharedPoolConfig, CachedItemList, type CachedListConfig };
|
|
@@ -16,6 +16,7 @@ export default class SharedPool<T extends Uint32Array | Int32Array | Float32Arra
|
|
|
16
16
|
private set type(value);
|
|
17
17
|
get dataLength(): number;
|
|
18
18
|
private set dataLength(value);
|
|
19
|
+
get bufferLength(): number;
|
|
19
20
|
constructor(memory: MemoryHeap, config?: SharedPoolConfig<T> | SharedPoolMemory);
|
|
20
21
|
at(index: number): T;
|
|
21
22
|
get(index: number, dataIndex?: number): number;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function addAtomicInt(array: Uint32Array | Int32Array, index: number, amount: number, max: number): void;
|
|
2
|
+
export declare function subtractAtomicInt(array: Uint32Array | Int32Array, index: number, amount: number, min: number): void;
|
|
3
|
+
export declare function addAtomicFloat32(array: Float32Array, index: number, amount: number, max: number): void;
|
|
4
|
+
export declare function subtractAtomicFloat(array: Float32Array, index: number, amount: number, min: number): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare function loadFloat32(data: Int32Array | Uint32Array, index: number): number;
|
|
2
|
-
export declare function storeFloat32(data: Int32Array | Uint32Array, index: number, value: number): void;
|
|
1
|
+
export declare function loadFloat32(data: Int32Array | Uint32Array | Float32Array, index: number): number;
|
|
2
|
+
export declare function storeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number): void;
|
|
3
3
|
export declare function convertInt32ToFloat32(value: number): number;
|
|
4
4
|
export declare function convertFloat32ToInt32(value: number): number;
|
|
5
|
-
export declare function exchangeFloat32(data: Int32Array | Uint32Array, index: number, value: number): number;
|
|
5
|
+
export declare function exchangeFloat32(data: Int32Array | Uint32Array | Float32Array, index: number, value: number): number;
|
|
6
|
+
export declare function compareExchangeFloat32(data: Int32Array | Uint32Array | Float32Array, 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.14",
|
|
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",
|