Commit e6135c27 authored by Michael Anthony Knyszek's avatar Michael Anthony Knyszek Committed by Michael Knyszek

runtime: switch to new page allocator

This change flips the oldPageAllocator constant enabling the new page
allocator in the Go runtime.

Updates #35112.

Change-Id: I7fc8332af9fd0e43ce28dd5ebc1c1ce519ce6d0c
Reviewed-on: https://go-review.googlesource.com/c/go/+/201765
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarAustin Clements <austin@google.com>
parent 52d5e76b
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
// fixalloc: a free-list allocator for fixed-size off-heap objects, // fixalloc: a free-list allocator for fixed-size off-heap objects,
// used to manage storage used by the allocator. // used to manage storage used by the allocator.
// mheap: the malloc heap, managed at page (8192-byte) granularity. // mheap: the malloc heap, managed at page (8192-byte) granularity.
// mspan: a run of pages managed by the mheap. // mspan: a run of in-use pages managed by the mheap.
// mcentral: collects all spans of a given size class. // mcentral: collects all spans of a given size class.
// mcache: a per-P cache of mspans with free space. // mcache: a per-P cache of mspans with free space.
// mstats: allocation statistics. // mstats: allocation statistics.
...@@ -56,13 +56,8 @@ ...@@ -56,13 +56,8 @@
// it is placed on the mcentral free list for the mspan's size // it is placed on the mcentral free list for the mspan's size
// class. // class.
// //
// 3. Otherwise, if all objects in the mspan are free, the mspan // 3. Otherwise, if all objects in the mspan are free, the mspan's
// is now "idle", so it is returned to the mheap and no longer // pages are returned to the mheap and the mspan is now dead.
// has a size class.
// This may coalesce it with adjacent idle mspans.
//
// 4. If an mspan remains idle for long enough, return its pages
// to the operating system.
// //
// Allocating and freeing a large object uses the mheap // Allocating and freeing a large object uses the mheap
// directly, bypassing the mcache and mcentral. // directly, bypassing the mcache and mcentral.
...@@ -324,7 +319,7 @@ const ( ...@@ -324,7 +319,7 @@ const (
minLegalPointer uintptr = 4096 minLegalPointer uintptr = 4096
// Whether to use the old page allocator or not. // Whether to use the old page allocator or not.
oldPageAllocator = true oldPageAllocator = false
) )
// physPageSize is the size in bytes of the OS's physical pages. // physPageSize is the size in bytes of the OS's physical pages.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment