March 2020
Intermediate to advanced
406 pages
8h 39m
English
Let's quickly discuss a couple of objects that are associated with Go's small object memory allocation.
mheap is the main malloc heap. It keeps track of global data, as well as many other heap details. Some important ones are as follows:
|
Name |
Description |
|
lock |
A mutex locking mechanism |
|
free |
An mTreap (a data structure that is a blend of a tree and a heap) of non-scavenged spans |
|
scav |
An mTreap of free and scavenged spans |
|
sweepgen |
An integer that keeps track of a span's swept status |
|
sweepdone |
Tracking whether all spans are swept |
|
sweepers |
The number of sweepone calls active |
mspan is the main ...
Read now
Unlock full access