• Austin Clements's avatar
    runtime: simplify and cleanup mallocinit · 1cc24690
    Austin Clements authored
    mallocinit has evolved organically. Make a pass to clean it up in
    various ways:
    
    1. Merge the computation of spansSize and bitmapSize. These were
       computed on every loop iteration of two different loops, but always
       have the same value, which can be derived directly from _MaxMem.
       This also avoids over-reserving these on MIPS, were _MaxArena32 is
       larger than _MaxMem.
    
    2. Remove the ulimit -v logic. It's been disabled for many releases
       and the dead code paths to support it are even more wrong now than
       they were when it was first disabled, since now we *must* reserve
       spans and bitmaps for the full address space.
    
    3. Make it clear that we're using a simple linear allocation to lay
       out the spans, bitmap, and arena spaces. Previously there were a
       lot of redundant pointer computations. Now we just bump p1 up as we
       reserve the spaces.
    
    In preparation for #18651.
    
    Updates #5049 (respect ulimit).
    
    Change-Id: Icbe66570d3a7a17bea227dc54fb3c4978b52a3af
    Reviewed-on: https://go-review.googlesource.com/35252Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    1cc24690
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...