[webkit-reviews] review granted: [Bug 182064] Replace tryLargeMemalignVirtual with tryLargeZeroedMemalignVirtual and use it to allocate large zeroed memory in Wasm : [Attachment 332687] patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jan 31 16:34:21 PST 2018
Geoffrey Garen <ggaren at apple.com> has granted Saam Barati <sbarati at apple.com>'s
request for review:
Bug 182064: Replace tryLargeMemalignVirtual with tryLargeZeroedMemalignVirtual
and use it to allocate large zeroed memory in Wasm
https://bugs.webkit.org/show_bug.cgi?id=182064
Attachment 332687: patch
https://bugs.webkit.org/attachment.cgi?id=332687&action=review
--- Comment #64 from Geoffrey Garen <ggaren at apple.com> ---
Comment on attachment 332687
--> https://bugs.webkit.org/attachment.cgi?id=332687
patch
View in context: https://bugs.webkit.org/attachment.cgi?id=332687&action=review
r=me
> Source/bmalloc/bmalloc/VMAllocate.h:145
> +inline size_t vmPageSizeVirtual()
> +{
> + static size_t cached;
> + if (!cached)
> + cached = getpagesize();
> + BASSERT(isPowerOfTwo(cached));
> + return cached;
> +}
> +
> +inline void vmValidateVirtual(size_t vmSize)
> +{
> + UNUSED(vmSize);
> + BASSERT(vmSize);
> + BASSERT(vmSize == roundUpToMultipleOf(vmPageSizeVirtual(), vmSize));
> +}
> +
> +inline void vmValidateVirtual(void* p, size_t vmSize)
> +{
> + vmValidateVirtual(vmSize);
> +
> + UNUSED(p);
> + BASSERT(p);
> + BASSERT(p == mask(p, ~(vmPageSizeVirtual() - 1)));
> +}
> +
vmPageSize() and vmValidate() operate on virtual pages. You can use them. If
you prefer the "Virtual" suffix, I'm cool with that. You'll just have to update
more call sites.
More information about the webkit-reviews
mailing list