@blaze-cache/core 0.2.0-beta → 0.2.3-beta
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 +67 -4
- package/dist/cache.d.ts +190 -11
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +419 -60
- package/dist/cache.js.map +1 -1
- package/dist/events.d.ts +84 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +179 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/persistence/indexeddb.d.ts.map +1 -1
- package/dist/persistence/indexeddb.js +19 -0
- package/dist/persistence/indexeddb.js.map +1 -1
- package/dist/persistence/types.d.ts +12 -0
- package/dist/persistence/types.d.ts.map +1 -1
- package/dist/types.d.ts +130 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/pkg/blaze_cache_wasm.d.ts +63 -1
- package/pkg/blaze_cache_wasm.js +179 -1
- package/pkg/blaze_cache_wasm_bg.wasm +0 -0
- package/pkg/blaze_cache_wasm_bg.wasm.d.ts +7 -0
- package/pkg/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -22,7 +22,17 @@ export function stableStringify(value) {
|
|
|
22
22
|
const source = raw;
|
|
23
23
|
const sorted = {};
|
|
24
24
|
for (const key of Object.keys(source).sort()) {
|
|
25
|
-
sorted[key] =
|
|
25
|
+
// Plain `sorted[key] = …` would *not* create an own property for a literal `__proto__`
|
|
26
|
+
// key: the inherited setter would swap `sorted`'s prototype instead, dropping the key
|
|
27
|
+
// from the output and mutating the fresh object we just allocated. `defineProperty`
|
|
28
|
+
// always defines an own data property, so hostile keys serialise normally — and only
|
|
29
|
+
// ever inside this throwaway `sorted`, never on `Object.prototype`.
|
|
30
|
+
Object.defineProperty(sorted, key, {
|
|
31
|
+
value: source[key],
|
|
32
|
+
enumerable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
});
|
|
26
36
|
}
|
|
27
37
|
return sorted;
|
|
28
38
|
});
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAE5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAY,EAAE,EAAE;QACxD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;QAC9E,MAAM,MAAM,GAAG,GAA8B,CAAC;QAC9C,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAE5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,GAAY,EAAE,EAAE;QACxD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;QAC9E,MAAM,MAAM,GAAG,GAA8B,CAAC;QAC9C,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,uFAAuF;YACvF,sFAAsF;YACtF,oFAAoF;YACpF,qFAAqF;YACrF,oEAAoE;YACpE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;gBACjC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC;gBAClB,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE,IAAI;aACnB,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,sFAAsF;IACtF,2DAA2D;IAC3D,OAAO,IAAI,IAAI,MAAM,CAAC;AACxB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,CAAC;QACH,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,10 +15,28 @@ export class BlazeCache {
|
|
|
15
15
|
* Empties the cache.
|
|
16
16
|
*/
|
|
17
17
|
clear(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Batch delete: returns `1` for each key that was present, `0` otherwise.
|
|
20
|
+
*/
|
|
21
|
+
deleteMany(keys: string[]): Uint8Array;
|
|
18
22
|
/**
|
|
19
23
|
* Removes `key`, returning whether it was there.
|
|
20
24
|
*/
|
|
21
25
|
delete(key: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Takes every drop recorded since the last call as
|
|
28
|
+
* `[{ key, value, reason: "evict" | "expire" }, …]`.
|
|
29
|
+
*
|
|
30
|
+
* Explicit `delete`, `deleteMany`, `invalidateTags`, `prune` and `clear` never show up
|
|
31
|
+
* here — the host issued those and already knows the result. Call this after each
|
|
32
|
+
* operation that could have reclaimed memory (any write, any read when TTLs exist)
|
|
33
|
+
* while drop listeners are installed.
|
|
34
|
+
*/
|
|
35
|
+
drainDrops(): Array<any>;
|
|
36
|
+
/**
|
|
37
|
+
* `true` while the drop log is being collected.
|
|
38
|
+
*/
|
|
39
|
+
dropTracking(): boolean;
|
|
22
40
|
/**
|
|
23
41
|
* Full snapshot — `{ key, value, ttlMs, tags }` for every live entry, oldest first.
|
|
24
42
|
*
|
|
@@ -31,12 +49,21 @@ export class BlazeCache {
|
|
|
31
49
|
* is missing or expired. Does not affect statistics or eviction state.
|
|
32
50
|
*/
|
|
33
51
|
entry(key: string): any;
|
|
52
|
+
/**
|
|
53
|
+
* Batch get: looks up every key in one boundary crossing. Returns `JsValue::UNDEFINED`
|
|
54
|
+
* for missing or expired entries. Each hit marks the entry visited for SIEVE.
|
|
55
|
+
*/
|
|
56
|
+
getMany(keys: string[]): any[];
|
|
34
57
|
/**
|
|
35
58
|
* Returns the value stored under `key`, or `undefined` when it is missing/expired.
|
|
36
59
|
*
|
|
37
60
|
* A hit marks the entry *visited* for SIEVE, so this takes `&mut self`.
|
|
38
61
|
*/
|
|
39
62
|
get(key: string): any | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Batch has: returns `1` for each key that is present and not expired, `0` otherwise.
|
|
65
|
+
*/
|
|
66
|
+
hasMany(keys: string[]): Uint8Array;
|
|
40
67
|
/**
|
|
41
68
|
* `true` when `key` carries `tag`.
|
|
42
69
|
*/
|
|
@@ -59,7 +86,18 @@ export class BlazeCache {
|
|
|
59
86
|
*/
|
|
60
87
|
keys(): string[];
|
|
61
88
|
/**
|
|
62
|
-
* Creates a cache that holds at most `capacity` entries
|
|
89
|
+
* Creates a cache that holds at most `capacity` entries.
|
|
90
|
+
*
|
|
91
|
+
* `capacity` arrives as a JS `Number`, so it is validated before anything else sees it:
|
|
92
|
+
*
|
|
93
|
+
* * non-finite (`NaN`, `Infinity`) — meaningless as a size, falls back to the default;
|
|
94
|
+
* * below `1` — clamped up to `1`, exactly as the core clamps `0`; note this also
|
|
95
|
+
* covers negatives, which JS→integer conversion would otherwise deliver as ~4.29e9;
|
|
96
|
+
* * above [`MAX_CAPACITY`] — clamped down, because `capacity()` reports it back and
|
|
97
|
+
* nobody builds a browser cache meant to hold a billion entries.
|
|
98
|
+
*
|
|
99
|
+
* The core also caps its own index reservation, so even an unvalidated number could no
|
|
100
|
+
* longer abort the instance with a huge up-front allocation.
|
|
63
101
|
*/
|
|
64
102
|
constructor(capacity: number);
|
|
65
103
|
/**
|
|
@@ -78,6 +116,23 @@ export class BlazeCache {
|
|
|
78
116
|
* Zeroes the cumulative counters. Stored entries are untouched.
|
|
79
117
|
*/
|
|
80
118
|
resetStats(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Starts (or stops) recording entries the cache drops **by itself** — capacity
|
|
121
|
+
* evictions and TTL expirations — so the host can observe them via
|
|
122
|
+
* [`drain_drops`](Self::drain_drops).
|
|
123
|
+
*
|
|
124
|
+
* Off by default: while off, the core pays nothing but a branch at the moment an
|
|
125
|
+
* entry dies, and `drain_drops()` returns an empty array. Turning it off also clears
|
|
126
|
+
* whatever has been recorded but not yet drained.
|
|
127
|
+
*/
|
|
128
|
+
setDropTracking(enabled: boolean): void;
|
|
129
|
+
/**
|
|
130
|
+
* Batch set: stores every key/value pair in one boundary crossing.
|
|
131
|
+
*
|
|
132
|
+
* `ttl_ms[i] < 0` means no expiry. `tag_offsets[i]`..`tag_offsets[i+1]` index into
|
|
133
|
+
* `tags_flat` for the tags of entry `i`.
|
|
134
|
+
*/
|
|
135
|
+
setMany(keys: string[], values: any, ttl_ms: Float64Array, tags_flat: string[], tag_offsets: Uint32Array): void;
|
|
81
136
|
/**
|
|
82
137
|
* Stores `value` under `key`.
|
|
83
138
|
*
|
|
@@ -135,10 +190,15 @@ export interface InitOutput {
|
|
|
135
190
|
readonly blazecache_capacity: (a: number) => number;
|
|
136
191
|
readonly blazecache_clear: (a: number) => void;
|
|
137
192
|
readonly blazecache_delete: (a: number, b: number, c: number) => number;
|
|
193
|
+
readonly blazecache_deleteMany: (a: number, b: number, c: number, d: number) => void;
|
|
194
|
+
readonly blazecache_drainDrops: (a: number) => number;
|
|
195
|
+
readonly blazecache_dropTracking: (a: number) => number;
|
|
138
196
|
readonly blazecache_entries: (a: number) => number;
|
|
139
197
|
readonly blazecache_entry: (a: number, b: number, c: number) => number;
|
|
140
198
|
readonly blazecache_get: (a: number, b: number, c: number) => number;
|
|
199
|
+
readonly blazecache_getMany: (a: number, b: number, c: number, d: number) => void;
|
|
141
200
|
readonly blazecache_has: (a: number, b: number, c: number) => number;
|
|
201
|
+
readonly blazecache_hasMany: (a: number, b: number, c: number, d: number) => void;
|
|
142
202
|
readonly blazecache_hasTag: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
143
203
|
readonly blazecache_invalidateTags: (a: number, b: number, c: number, d: number) => void;
|
|
144
204
|
readonly blazecache_keys: (a: number, b: number) => void;
|
|
@@ -148,6 +208,8 @@ export interface InitOutput {
|
|
|
148
208
|
readonly blazecache_prune: (a: number, b: number) => void;
|
|
149
209
|
readonly blazecache_resetStats: (a: number) => void;
|
|
150
210
|
readonly blazecache_set: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
211
|
+
readonly blazecache_setDropTracking: (a: number, b: number) => void;
|
|
212
|
+
readonly blazecache_setMany: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
151
213
|
readonly blazecache_size: (a: number) => number;
|
|
152
214
|
readonly blazecache_stats: (a: number, b: number) => void;
|
|
153
215
|
readonly blazecache_tagsOf: (a: number, b: number, c: number, d: number) => void;
|
package/pkg/blaze_cache_wasm.js
CHANGED
|
@@ -28,6 +28,26 @@ export class BlazeCache {
|
|
|
28
28
|
clear() {
|
|
29
29
|
wasm.blazecache_clear(this.__wbg_ptr);
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Batch delete: returns `1` for each key that was present, `0` otherwise.
|
|
33
|
+
* @param {string[]} keys
|
|
34
|
+
* @returns {Uint8Array}
|
|
35
|
+
*/
|
|
36
|
+
deleteMany(keys) {
|
|
37
|
+
try {
|
|
38
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
39
|
+
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
40
|
+
const len0 = WASM_VECTOR_LEN;
|
|
41
|
+
wasm.blazecache_deleteMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
42
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
43
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
44
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
45
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
46
|
+
return v2;
|
|
47
|
+
} finally {
|
|
48
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
31
51
|
/**
|
|
32
52
|
* Removes `key`, returning whether it was there.
|
|
33
53
|
* @param {string} key
|
|
@@ -39,6 +59,28 @@ export class BlazeCache {
|
|
|
39
59
|
const ret = wasm.blazecache_delete(this.__wbg_ptr, ptr0, len0);
|
|
40
60
|
return ret !== 0;
|
|
41
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Takes every drop recorded since the last call as
|
|
64
|
+
* `[{ key, value, reason: "evict" | "expire" }, …]`.
|
|
65
|
+
*
|
|
66
|
+
* Explicit `delete`, `deleteMany`, `invalidateTags`, `prune` and `clear` never show up
|
|
67
|
+
* here — the host issued those and already knows the result. Call this after each
|
|
68
|
+
* operation that could have reclaimed memory (any write, any read when TTLs exist)
|
|
69
|
+
* while drop listeners are installed.
|
|
70
|
+
* @returns {Array<any>}
|
|
71
|
+
*/
|
|
72
|
+
drainDrops() {
|
|
73
|
+
const ret = wasm.blazecache_drainDrops(this.__wbg_ptr);
|
|
74
|
+
return takeObject(ret);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `true` while the drop log is being collected.
|
|
78
|
+
* @returns {boolean}
|
|
79
|
+
*/
|
|
80
|
+
dropTracking() {
|
|
81
|
+
const ret = wasm.blazecache_dropTracking(this.__wbg_ptr);
|
|
82
|
+
return ret !== 0;
|
|
83
|
+
}
|
|
42
84
|
/**
|
|
43
85
|
* Full snapshot — `{ key, value, ttlMs, tags }` for every live entry, oldest first.
|
|
44
86
|
*
|
|
@@ -62,6 +104,27 @@ export class BlazeCache {
|
|
|
62
104
|
const ret = wasm.blazecache_entry(this.__wbg_ptr, ptr0, len0);
|
|
63
105
|
return takeObject(ret);
|
|
64
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Batch get: looks up every key in one boundary crossing. Returns `JsValue::UNDEFINED`
|
|
109
|
+
* for missing or expired entries. Each hit marks the entry visited for SIEVE.
|
|
110
|
+
* @param {string[]} keys
|
|
111
|
+
* @returns {any[]}
|
|
112
|
+
*/
|
|
113
|
+
getMany(keys) {
|
|
114
|
+
try {
|
|
115
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
116
|
+
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
117
|
+
const len0 = WASM_VECTOR_LEN;
|
|
118
|
+
wasm.blazecache_getMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
119
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
120
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
121
|
+
var v2 = getArrayJsValueFromWasm0(r0, r1);
|
|
122
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
123
|
+
return v2;
|
|
124
|
+
} finally {
|
|
125
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
65
128
|
/**
|
|
66
129
|
* Returns the value stored under `key`, or `undefined` when it is missing/expired.
|
|
67
130
|
*
|
|
@@ -75,6 +138,26 @@ export class BlazeCache {
|
|
|
75
138
|
const ret = wasm.blazecache_get(this.__wbg_ptr, ptr0, len0);
|
|
76
139
|
return takeObject(ret);
|
|
77
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Batch has: returns `1` for each key that is present and not expired, `0` otherwise.
|
|
143
|
+
* @param {string[]} keys
|
|
144
|
+
* @returns {Uint8Array}
|
|
145
|
+
*/
|
|
146
|
+
hasMany(keys) {
|
|
147
|
+
try {
|
|
148
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
149
|
+
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
151
|
+
wasm.blazecache_hasMany(retptr, this.__wbg_ptr, ptr0, len0);
|
|
152
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
153
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
154
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
155
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
156
|
+
return v2;
|
|
157
|
+
} finally {
|
|
158
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
78
161
|
/**
|
|
79
162
|
* `true` when `key` carries `tag`.
|
|
80
163
|
* @param {string} key
|
|
@@ -159,7 +242,18 @@ export class BlazeCache {
|
|
|
159
242
|
}
|
|
160
243
|
}
|
|
161
244
|
/**
|
|
162
|
-
* Creates a cache that holds at most `capacity` entries
|
|
245
|
+
* Creates a cache that holds at most `capacity` entries.
|
|
246
|
+
*
|
|
247
|
+
* `capacity` arrives as a JS `Number`, so it is validated before anything else sees it:
|
|
248
|
+
*
|
|
249
|
+
* * non-finite (`NaN`, `Infinity`) — meaningless as a size, falls back to the default;
|
|
250
|
+
* * below `1` — clamped up to `1`, exactly as the core clamps `0`; note this also
|
|
251
|
+
* covers negatives, which JS→integer conversion would otherwise deliver as ~4.29e9;
|
|
252
|
+
* * above [`MAX_CAPACITY`] — clamped down, because `capacity()` reports it back and
|
|
253
|
+
* nobody builds a browser cache meant to hold a billion entries.
|
|
254
|
+
*
|
|
255
|
+
* The core also caps its own index reservation, so even an unvalidated number could no
|
|
256
|
+
* longer abort the instance with a huge up-front allocation.
|
|
163
257
|
* @param {number} capacity
|
|
164
258
|
*/
|
|
165
259
|
constructor(capacity) {
|
|
@@ -206,6 +300,41 @@ export class BlazeCache {
|
|
|
206
300
|
resetStats() {
|
|
207
301
|
wasm.blazecache_resetStats(this.__wbg_ptr);
|
|
208
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Starts (or stops) recording entries the cache drops **by itself** — capacity
|
|
305
|
+
* evictions and TTL expirations — so the host can observe them via
|
|
306
|
+
* [`drain_drops`](Self::drain_drops).
|
|
307
|
+
*
|
|
308
|
+
* Off by default: while off, the core pays nothing but a branch at the moment an
|
|
309
|
+
* entry dies, and `drain_drops()` returns an empty array. Turning it off also clears
|
|
310
|
+
* whatever has been recorded but not yet drained.
|
|
311
|
+
* @param {boolean} enabled
|
|
312
|
+
*/
|
|
313
|
+
setDropTracking(enabled) {
|
|
314
|
+
wasm.blazecache_setDropTracking(this.__wbg_ptr, enabled);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Batch set: stores every key/value pair in one boundary crossing.
|
|
318
|
+
*
|
|
319
|
+
* `ttl_ms[i] < 0` means no expiry. `tag_offsets[i]`..`tag_offsets[i+1]` index into
|
|
320
|
+
* `tags_flat` for the tags of entry `i`.
|
|
321
|
+
* @param {string[]} keys
|
|
322
|
+
* @param {any} values
|
|
323
|
+
* @param {Float64Array} ttl_ms
|
|
324
|
+
* @param {string[]} tags_flat
|
|
325
|
+
* @param {Uint32Array} tag_offsets
|
|
326
|
+
*/
|
|
327
|
+
setMany(keys, values, ttl_ms, tags_flat, tag_offsets) {
|
|
328
|
+
const ptr0 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_export);
|
|
329
|
+
const len0 = WASM_VECTOR_LEN;
|
|
330
|
+
const ptr1 = passArrayF64ToWasm0(ttl_ms, wasm.__wbindgen_export);
|
|
331
|
+
const len1 = WASM_VECTOR_LEN;
|
|
332
|
+
const ptr2 = passArrayJsValueToWasm0(tags_flat, wasm.__wbindgen_export);
|
|
333
|
+
const len2 = WASM_VECTOR_LEN;
|
|
334
|
+
const ptr3 = passArray32ToWasm0(tag_offsets, wasm.__wbindgen_export);
|
|
335
|
+
const len3 = WASM_VECTOR_LEN;
|
|
336
|
+
wasm.blazecache_setMany(this.__wbg_ptr, ptr0, len0, addHeapObject(values), ptr1, len1, ptr2, len2, ptr3, len3);
|
|
337
|
+
}
|
|
209
338
|
/**
|
|
210
339
|
* Stores `value` under `key`.
|
|
211
340
|
*
|
|
@@ -364,6 +493,18 @@ function __wbg_get_imports() {
|
|
|
364
493
|
wasm.__wbindgen_export3(deferred0_0, deferred0_1, 1);
|
|
365
494
|
}
|
|
366
495
|
},
|
|
496
|
+
__wbg_from_296ca31f8d0f1c52: function(arg0) {
|
|
497
|
+
const ret = Array.from(getObject(arg0));
|
|
498
|
+
return addHeapObject(ret);
|
|
499
|
+
},
|
|
500
|
+
__wbg_get_6c896e0571ddae51: function(arg0, arg1) {
|
|
501
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
502
|
+
return addHeapObject(ret);
|
|
503
|
+
},
|
|
504
|
+
__wbg_length_d4bdea10311bd9cf: function(arg0) {
|
|
505
|
+
const ret = getObject(arg0).length;
|
|
506
|
+
return ret;
|
|
507
|
+
},
|
|
367
508
|
__wbg_new_227d7c05414eb861: function() {
|
|
368
509
|
const ret = new Error();
|
|
369
510
|
return addHeapObject(ret);
|
|
@@ -476,6 +617,11 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
476
617
|
return result;
|
|
477
618
|
}
|
|
478
619
|
|
|
620
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
621
|
+
ptr = ptr >>> 0;
|
|
622
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
623
|
+
}
|
|
624
|
+
|
|
479
625
|
let cachedDataViewMemory0 = null;
|
|
480
626
|
function getDataViewMemory0() {
|
|
481
627
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
@@ -484,10 +630,26 @@ function getDataViewMemory0() {
|
|
|
484
630
|
return cachedDataViewMemory0;
|
|
485
631
|
}
|
|
486
632
|
|
|
633
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
634
|
+
function getFloat64ArrayMemory0() {
|
|
635
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
636
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
637
|
+
}
|
|
638
|
+
return cachedFloat64ArrayMemory0;
|
|
639
|
+
}
|
|
640
|
+
|
|
487
641
|
function getStringFromWasm0(ptr, len) {
|
|
488
642
|
return decodeText(ptr >>> 0, len);
|
|
489
643
|
}
|
|
490
644
|
|
|
645
|
+
let cachedUint32ArrayMemory0 = null;
|
|
646
|
+
function getUint32ArrayMemory0() {
|
|
647
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
648
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
649
|
+
}
|
|
650
|
+
return cachedUint32ArrayMemory0;
|
|
651
|
+
}
|
|
652
|
+
|
|
491
653
|
let cachedUint8ArrayMemory0 = null;
|
|
492
654
|
function getUint8ArrayMemory0() {
|
|
493
655
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -515,6 +677,20 @@ function isLikeNone(x) {
|
|
|
515
677
|
return x === undefined || x === null;
|
|
516
678
|
}
|
|
517
679
|
|
|
680
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
681
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
682
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
683
|
+
WASM_VECTOR_LEN = arg.length;
|
|
684
|
+
return ptr;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function passArrayF64ToWasm0(arg, malloc) {
|
|
688
|
+
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
689
|
+
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
690
|
+
WASM_VECTOR_LEN = arg.length;
|
|
691
|
+
return ptr;
|
|
692
|
+
}
|
|
693
|
+
|
|
518
694
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
519
695
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
520
696
|
const mem = getDataViewMemory0();
|
|
@@ -603,6 +779,8 @@ function __wbg_finalize_init(instance, module) {
|
|
|
603
779
|
wasm = instance.exports;
|
|
604
780
|
wasmModule = module;
|
|
605
781
|
cachedDataViewMemory0 = null;
|
|
782
|
+
cachedFloat64ArrayMemory0 = null;
|
|
783
|
+
cachedUint32ArrayMemory0 = null;
|
|
606
784
|
cachedUint8ArrayMemory0 = null;
|
|
607
785
|
return wasm;
|
|
608
786
|
}
|
|
Binary file
|
|
@@ -5,10 +5,15 @@ export const __wbg_blazecache_free: (a: number, b: number) => void;
|
|
|
5
5
|
export const blazecache_capacity: (a: number) => number;
|
|
6
6
|
export const blazecache_clear: (a: number) => void;
|
|
7
7
|
export const blazecache_delete: (a: number, b: number, c: number) => number;
|
|
8
|
+
export const blazecache_deleteMany: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const blazecache_drainDrops: (a: number) => number;
|
|
10
|
+
export const blazecache_dropTracking: (a: number) => number;
|
|
8
11
|
export const blazecache_entries: (a: number) => number;
|
|
9
12
|
export const blazecache_entry: (a: number, b: number, c: number) => number;
|
|
10
13
|
export const blazecache_get: (a: number, b: number, c: number) => number;
|
|
14
|
+
export const blazecache_getMany: (a: number, b: number, c: number, d: number) => void;
|
|
11
15
|
export const blazecache_has: (a: number, b: number, c: number) => number;
|
|
16
|
+
export const blazecache_hasMany: (a: number, b: number, c: number, d: number) => void;
|
|
12
17
|
export const blazecache_hasTag: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
13
18
|
export const blazecache_invalidateTags: (a: number, b: number, c: number, d: number) => void;
|
|
14
19
|
export const blazecache_keys: (a: number, b: number) => void;
|
|
@@ -18,6 +23,8 @@ export const blazecache_peek: (a: number, b: number, c: number) => number;
|
|
|
18
23
|
export const blazecache_prune: (a: number, b: number) => void;
|
|
19
24
|
export const blazecache_resetStats: (a: number) => void;
|
|
20
25
|
export const blazecache_set: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
|
|
26
|
+
export const blazecache_setDropTracking: (a: number, b: number) => void;
|
|
27
|
+
export const blazecache_setMany: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
21
28
|
export const blazecache_size: (a: number) => number;
|
|
22
29
|
export const blazecache_stats: (a: number, b: number) => void;
|
|
23
30
|
export const blazecache_tagsOf: (a: number, b: number, c: number, d: number) => void;
|