]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: switch to new page allocator
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 28 Oct 2019 20:38:59 +0000 (20:38 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 7 Nov 2019 23:55:56 +0000 (23:55 +0000)
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: Austin Clements <austin@google.com>
src/runtime/malloc.go

index 2fd71fab2d75461413f01c349a99a14917abeaef..ef1c975cea30958d3bc6334e3b5ea513dad27324 100644 (file)
@@ -19,7 +19,7 @@
 //     fixalloc: a free-list allocator for fixed-size off-heap objects,
 //             used to manage storage used by the allocator.
 //     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.
 //     mcache: a per-P cache of mspans with free space.
 //     mstats: allocation statistics.
 //        it is placed on the mcentral free list for the mspan's size
 //        class.
 //
-//     3. Otherwise, if all objects in the mspan are free, the mspan
-//        is now "idle", so it is returned to the mheap and no longer
-//        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.
+//     3. Otherwise, if all objects in the mspan are free, the mspan's
+//        pages are returned to the mheap and the mspan is now dead.
 //
 // Allocating and freeing a large object uses the mheap
 // directly, bypassing the mcache and mcentral.
@@ -324,7 +319,7 @@ const (
        minLegalPointer uintptr = 4096
 
        // 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.