mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb: Register Wasm memory grow hook in constructor of Memory objects
Previously it would only register the hook for JavaScript constructed Memory objects. This allows Ruffle to load again.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
f2eaf3381f
commit
d2acf32aae
@@ -39,10 +39,6 @@ WebIDL::ExceptionOr<GC::Ref<Memory>> Memory::construct_impl(JS::Realm& realm, Me
|
||||
|
||||
auto memory_object = realm.create<Memory>(realm, *address, shared ? Shared::Yes : Shared::No);
|
||||
|
||||
cache.abstract_machine().store().get(*address)->successful_grow_hook = [memory_object] {
|
||||
MUST(memory_object->reset_the_memory_buffer());
|
||||
};
|
||||
|
||||
return memory_object;
|
||||
}
|
||||
|
||||
@@ -51,6 +47,11 @@ Memory::Memory(JS::Realm& realm, Wasm::MemoryAddress address, Shared shared)
|
||||
, m_address(address)
|
||||
, m_shared(shared)
|
||||
{
|
||||
auto& cache = Detail::get_cache(realm);
|
||||
|
||||
cache.abstract_machine().store().get(address)->successful_grow_hook = [this] {
|
||||
MUST(reset_the_memory_buffer());
|
||||
};
|
||||
}
|
||||
|
||||
void Memory::initialize(JS::Realm& realm)
|
||||
|
||||
Reference in New Issue
Block a user