]> Cypherpunks repositories - gostls13.git/commit
runtime: fix sysUsed for Windows
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 11 Dec 2018 18:26:42 +0000 (18:26 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 17 Dec 2018 22:42:27 +0000 (22:42 +0000)
commit213845f7b932c72c5e49445224166d0ae14dfac9
tree89e42a6847d37869c14e61a42ade7d495080ed8e
parent81a908aa685c5c3e68ded0fe542e7f3983d9dc85
runtime: fix sysUsed for Windows

sysUsed on Windows cares about the result from the VirtualAlloc syscall
returning exactly the address that was passed to it. However,
VirtualAlloc aligns the address its given to the kernel's allocation
granularity, so the returned address may not be the same.

Note that this wasn't an issue in the past because we only sysUsed
regions owned by spans, and spans are always a multiple of 8K, which
is a multiple of the allocation granularity on most Windows machines.

Change-Id: I3f5ccd63c6bbbd8b7995945ecedee17573b31667
Reviewed-on: https://go-review.googlesource.com/c/153677
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mem_windows.go