Bug 233674

Summary: [Win] OSAllocator::reserveUncommittedAligned should use aligned allocation
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Web Template FrameworkAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, don.olmstead, ews-watchlist, keith_miller, ross.kirsling, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Fujii Hironori 2021-11-30 18:14:30 PST
[Win] OSAllocator::reserveUncommittedAligned should use aligned allocation

It has a FIXME comment (Added by Bug 233379):

>  // FIXME: Is there a way to do this where we can either release the excess reservation or not reserve it at all?
>  void* result = reserveUncommitted(2 * bytes, usage, writable, executable);
Comment 1 Fujii Hironori 2021-11-30 18:16:46 PST
The document of VirtualAlloc2 has a sample code.
"Scenario 3. Allocate memory in a specific virtual address range (below 4GB, in this example) and with specific alignment."
https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc2
Comment 2 Fujii Hironori 2021-11-30 20:39:22 PST
Created attachment 445508 [details]
Patch
Comment 3 Keith Miller 2021-12-01 05:55:38 PST
Comment on attachment 445508 [details]
Patch

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

> Source/WTF/wtf/win/OSAllocatorWin.cpp:69
>      // FIXME: Is there a way to do this where we can either release the excess reservation or not reserve it at all?

Nit: I'd remove this FIXME at this point.
Comment 4 Fujii Hironori 2021-12-01 12:28:05 PST
Created attachment 445603 [details]
Patch for landing

Thank you for the review.
Comment 5 Fujii Hironori 2021-12-01 12:30:05 PST
Committed r286377 (244736@main): <https://commits.webkit.org/244736@main>
Comment 6 Radar WebKit Bug Importer 2021-12-01 12:31:25 PST
<rdar://problem/85934857>