Bug 233674 - [Win] OSAllocator::reserveUncommittedAligned should use aligned allocation
Summary: [Win] OSAllocator::reserveUncommittedAligned should use aligned allocation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-30 18:14 PST by Fujii Hironori
Modified: 2021-12-01 12:31 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.45 KB, patch)
2021-11-30 20:39 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch for landing (2.58 KB, patch)
2021-12-01 12:28 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>