allocator: Add Windows _aligned_* shims
On Windows we don’t currently hook the _aligned_* allocation APIs, this can cause issues because _aligned_realloc can call HeapSize and cause GWP-ASan crashes similar to bug 909720. Unfortunately the _aligned_realloc API is different enough that it can not be implemented using the standard POSIX shims, in particular because _aligned_malloc and _aligned_free don't return valid allocation addresses, they are offsets into allocations. I add new Windows platform-specific shims for _aligned_malloc, _aligned_realloc, and _aligned_free and wire them in for all users of the allocator shims. I implement these routines on top of the Windows Heap* API and leave uncommon _aligned_* shims to crash to ensure that any future uses immediately surface why their use fails. Bug: 912500, 896019 Change-Id: Ieaa50b816ab277a6ad4b80ee8519027343fa9878 Reviewed-on: https://chromium-review.googlesource.com/c/1367485Reviewed-by:danakj <danakj@chromium.org> Reviewed-by:
Vitaly Buka <vitalybuka@chromium.org> Reviewed-by:
Alexei Filippov <alph@chromium.org> Reviewed-by:
Erik Chen <erikchen@chromium.org> Reviewed-by:
Will Harris <wfh@chromium.org> Reviewed-by:
Sigurður Ásgeirsson <siggi@chromium.org> Commit-Queue: Vlad Tsyrklevich <vtsyrklevich@chromium.org> Cr-Commit-Position: refs/heads/master@{#616106}
Showing
Please register or sign in to comment