reflect.ValueOf
function calls will not always allocate and escale the values referenced by their arguments.clear
builtin function.type _ int
are modified accordingly, including the one in the last section ("Grow stack in less times") of the "Stack and Escape Analysis" chapter.copy(s, s)
is a no-op, but append(s[:0], s...)
is not.-gcflags="-d=ssa/check_bce"
doesn't work for some generic functions.Garbage Collection
chapter is updated much. The update contents are mainly in the last 4 sections (starting the Use new heap memory percentage strategy to control automatic GC frequency
section). Some descriptions in the first section GC pacer
are also modified a bit.Stack and Escape Analysis
chapter, the descriptions about initial stack sizes in the Stacks growth and shrinkage
section are modified.BCE
chapter, a new Example 4
section is added. The example was in the Sometimes, the compiler needs some hints to remove some bound checks
section.Functions
chapter, the Which functions are inline-able?
section states that functions containing select
code blocks may be inlined since Go toolchain 1.19.The Go 101 project is hosted on Github. Welcome to improve Go 101 articles by submitting corrections for all kinds of mistakes, such as typos, grammar errors, wording inaccuracies, description flaws, code bugs and broken links.
If you would like to learn some Go details and facts every serveral days, please follow Go 101's official Twitter account @zigo_101.