Rounds up VirtualAlloc calls on windows to dwAllocationGranularity to prevent fragmentation
Rounds up VirtualAlloc calls on windows to dwAllocationGranularity to prevent fragmentation

Actually on Windows VirtualAlloc'ated address might have bigger alignment than reported by SYSTEM_INFO.dwPageSize, see SYSTEM_INFO.dwAllocationGranularity.

As coalescing of spans in tcmalloc requires that those spans are physically adjacent, using smaller alignment inhibited coalescing. Additional benefit is we now
require ways less memory at least in some case.

Also adds assert()s for alignment values that would lead to pathological virtual address space waste.  No current callers pass in alignment values other than kPageSize and it's unlikely anyone will.

Original patch and discussion was at http://codereview.chromium.org/235003

Patch by: antonm@chromium.org

BUG=22701
TEST=Manually checked test page that did 10m XHR. Memory use goes from >2GB and a crash to 102MB. Membuster shows the change is roughly within noise and possibly a very slight regression ( <<5% ).

Review URL: http://codereview.chromium.org/222028

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@27162 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser