@swmansion/popcorn 0.4.0-next.3 → 0.4.0-next.5
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 +13 -4
- package/dist/events.d.ts +1 -1
- package/dist/index.mjs +26 -4
- package/dist/plugins/vite.mjs +6 -1
- package/dist/popcorn.d.ts +15 -4
- package/dist/runtimes/core/beam.emu.mjs +126 -128
- package/dist/runtimes/core/beam.mjs +126 -128
- package/dist/runtimes/core/beam.wasm +0 -0
- package/dist/runtimes/crypto/beam.emu.mjs +108 -111
- package/dist/runtimes/crypto/beam.mjs +108 -111
- package/dist/runtimes/crypto/beam.wasm +0 -0
- package/dist/types.d.ts +3 -0
- package/dist/worker.mjs +8 -0
- package/package.json +1 -1
|
Binary file
|
package/dist/types.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export type BeamBootOptions = {
|
|
|
44
44
|
extraArgs?: string[];
|
|
45
45
|
/** VM environment variables. */
|
|
46
46
|
env?: Record<string, string>;
|
|
47
|
+
/** Resolved maximum Wasm linear memory in bytes. */
|
|
48
|
+
maxMemoryBytes?: number;
|
|
47
49
|
ttySize: TtySize;
|
|
48
50
|
noshell: boolean;
|
|
49
51
|
createModule: CreateModuleFn<EmscriptenModule>;
|
|
@@ -105,6 +107,7 @@ export type TtySize = {
|
|
|
105
107
|
};
|
|
106
108
|
/** Emscripten Module interface (subset exposed after instantiation). */
|
|
107
109
|
export type EmscriptenModule = {
|
|
110
|
+
wasmMemory?: WebAssembly.Memory;
|
|
108
111
|
ENV: Record<string, string>;
|
|
109
112
|
FS_mkdirTree: (path: string) => void;
|
|
110
113
|
FS_createDataFile: (parent: string, name: string | null, data: Uint8Array, canRead: boolean, canWrite: boolean, canOwn: boolean) => void;
|
package/dist/worker.mjs
CHANGED
|
@@ -537,6 +537,13 @@ async function boot(opts, state, vm) {
|
|
|
537
537
|
],
|
|
538
538
|
};
|
|
539
539
|
try {
|
|
540
|
+
if (opts.maxMemoryBytes !== undefined) {
|
|
541
|
+
moduleConfig.wasmMemory = new WebAssembly.Memory({
|
|
542
|
+
initial: 1024,
|
|
543
|
+
maximum: opts.maxMemoryBytes / 65536,
|
|
544
|
+
shared: true,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
540
547
|
const ready = Promise.all([vmReady, appReady]);
|
|
541
548
|
const module = await createModule(moduleConfig);
|
|
542
549
|
check(state.module === module);
|
|
@@ -789,6 +796,7 @@ self.onmessage = async (event) => {
|
|
|
789
796
|
emulatorArgs: data.payload.emulatorArgs,
|
|
790
797
|
extraArgs: data.payload.extraArgs,
|
|
791
798
|
env: data.payload.env,
|
|
799
|
+
maxMemoryBytes: data.payload.maxMemoryBytes,
|
|
792
800
|
ttySize: data.payload.ttySize,
|
|
793
801
|
noshell: data.payload.noshell,
|
|
794
802
|
createModule,
|