-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storeBuffer optimization #1505
storeBuffer optimization #1505
Conversation
@@ -296,4 +297,103 @@ namespace kagome::runtime::binaryen { | |||
return callHostApiFunc<mf>(this_.host_api_.get(), arguments); | |||
} | |||
|
|||
void RuntimeExternalInterface::init(wasm::Module &wasm, | |||
wasm::ModuleInstance &instance) { | |||
memory.resize(wasm.memory.initial * wasm::Memory::kPageSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we fill it with zeroes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По идее нет. init
вызывается для объекта 1 раз в ModuleInstanceBase::ctor()
. При ресайзе, память свыше memory.size()
будет проинициализирована нулями, потому что default-inserted для интегральных типов 0. Т.е. на первом вызове это будет аллокация буффера проинициализированного нулями. Судя по коду не предполагается использовать объект RuntimeExternalInterface::memory
до вызова init
. Так что тут скорее вопросы к resize
в ctor
.
61772ba
to
9734e1e
Compare
9734e1e
to
e01a82f
Compare
Signed-off-by: iceseer <[email protected]>
e01a82f
to
7f8a3a6
Compare
Description of the Change
Remove looped set of value into memory buffer.