March 2020
Intermediate to advanced
406 pages
8h 39m
English
As we learned in Chapter 3, Understanding Concurrency, the Go runtime uses the G struct to represent stack parameters for a single goroutine. The P struct manages logical processors for execution. The malloc that is used as part of the Go runtime, defined at https://golang.org/src/runtime/malloc.go, does a lot of work. Go uses mmap to ask the underlying OS directly for memory. Small allocation sizes (memory allocations up to and including 32 kB) are handled separately from large memory allocations.
Read now
Unlock full access