[webkit-reviews] review granted: [Bug 170628] WebAssembly: manage memory better : [Attachment 306933] patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 13 12:10:39 PDT 2017

Keith Miller <keith_miller at apple.com> has granted JF Bastien
<jfbastien at apple.com>'s request for review:
Bug 170628: WebAssembly: manage memory better

Attachment 306933: patch


--- Comment #26 from Keith Miller <keith_miller at apple.com> ---
Comment on attachment 306933
  --> https://bugs.webkit.org/attachment.cgi?id=306933

View in context: https://bugs.webkit.org/attachment.cgi?id=306933&action=review

r=me with more comments.

> Source/JavaScriptCore/wasm/WasmMemory.cpp:480
> +    void* newMemory = tryGetSlowMemory(desiredSize);

I'm not sure we want to grow to the exact size. Usually you want to double up
so you can avoid the pathological case of repeatedly calling grow(1).

I would make this:

std::min(std::max(desiredSize, m_mappedCapacity * 2), 2 << 32).

> Websites/webkit.org/docs/b3/intermediate-representation.html:659
> +	   InvalidGPR in which case the out-of-bounds limit is 4GiB. In the
later case a maximum parameter

nit: I think you need a comma after InvalidGPR.

More information about the webkit-reviews mailing list