• Austin Clements's avatar
    runtime: fetch physical page size from the OS · 276a52de
    Austin Clements authored
    Currently the physical page size assumed by the runtime is hard-coded.
    On Linux the runtime at least fetches the OS page size during init and
    sanity checks against the hard-coded value, but they may still differ.
    On other OSes we wouldn't even notice.
    
    Add support on all OSes to fetch the actual OS physical page size
    during runtime init and lift the sanity check of PhysPageSize from the
    Linux init code to general malloc init. Currently this is the only use
    of the retrieved page size, but we'll add more shortly.
    
    Updates #12480 and #10180.
    
    Change-Id: I065f2834bc97c71d3208edc17fd990ec9058b6da
    Reviewed-on: https://go-review.googlesource.com/25050
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    276a52de
os_linux.go 11.9 KB