Skip to content

Commit

Permalink
LibWeb: Don't grow Wasm memory again after initialisation
Browse files Browse the repository at this point in the history
The constructor grows the memory to the initial size, we don't need to
do that again.
  • Loading branch information
alimpfard authored and linusg committed Aug 23, 2022
1 parent b9fc9ae commit e70624d
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyMemoryConstructor::construct(Funct
if (!address.has_value())
return vm.throw_completion<JS::TypeError>("Wasm Memory allocation failed");

if (!WebAssemblyObject::s_abstract_machine.store().get(*address)->grow(initial))
return vm.throw_completion<JS::TypeError>(String::formatted("Wasm Memory grow failed: {}", initial));

return vm.heap().allocate<WebAssemblyMemoryObject>(realm, realm, *address);
}

Expand Down

0 comments on commit e70624d

Please sign in to comment.