mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-12 22:05:33 +00:00
Enable shared memory in emscripten
This commit is contained in:
parent
24e7c1b263
commit
b1f868dc52
@ -440,13 +440,13 @@ impl EmscriptenGlobals {
|
||||
}
|
||||
|
||||
let (table_min, table_max) = get_emscripten_table_size(&module);
|
||||
let (memory_min, memory_max) = get_emscripten_memory_size(&module);
|
||||
let (memory_min, memory_max, shared) = get_emscripten_memory_size(&module);
|
||||
|
||||
// Memory initialization
|
||||
let memory_type = MemoryDescriptor {
|
||||
minimum: memory_min,
|
||||
maximum: memory_max,
|
||||
shared: false,
|
||||
shared: shared,
|
||||
};
|
||||
let memory = Memory::new(memory_type).unwrap();
|
||||
|
||||
|
@ -36,9 +36,9 @@ pub fn get_emscripten_table_size(module: &Module) -> (u32, Option<u32>) {
|
||||
(table.minimum, table.maximum)
|
||||
}
|
||||
|
||||
pub fn get_emscripten_memory_size(module: &Module) -> (Pages, Option<Pages>) {
|
||||
pub fn get_emscripten_memory_size(module: &Module) -> (Pages, Option<Pages>, bool) {
|
||||
let (_, memory) = &module.info().imported_memories[ImportedMemoryIndex::new(0)];
|
||||
(memory.minimum, memory.maximum)
|
||||
(memory.minimum, memory.maximum, memory.shared)
|
||||
}
|
||||
|
||||
/// Reads values written by `-s EMIT_EMSCRIPTEN_METADATA=1`
|
||||
|
Loading…
Reference in New Issue
Block a user