topics/go/language/pointers/README.md
Pointers provide a way to share data across program boundaries. Having the ability to share and reference data with a pointer provides the benefit of efficiency. There is only one copy of the data and everyone can see it changing. The cost is that anyone can change the data which can cause side effects in running programs.
The design of the Go GC has changed over the years:
Garbage Collection Semantics Part I - William Kennedy
_"The stack is for data that needs to persist only for the lifetime of the function that constructs it, and is reclaimed without any cost when the function exits. The heap is for data that needs to persist after the function that constructs it exits, and is reclaimed by a sometimes costly garbage collection." - Ayan George
Pointers vs. Values
Language Mechanics On Stacks And Pointers - William Kennedy
Using Pointers In Go - William Kennedy
Understanding Pointers and Memory Allocation - William Kennedy
Go Escape Analysis Flaws
Compiler Optimizations
The Garbage Collection Handbook
GC Pacer Redesign - 2021 - Michael Knyszek
Tracing Garbage Collection
Go Blog - 1.5 GC
Go GC: Solving the Latency Problem
Concurrent garbage collection
Go 1.5 concurrent garbage collector pacing
Eliminating Stack Re-Scanning
Why golang garbage-collector not implement Generational and Compact gc? - Ian Lance Taylor
Getting to Go: The Journey of Go's Garbage Collector - Rick Hudson
Garbage Collection In Go : Part I - Semantics - William Kennedy
Garbage Collection In Go : Part II - GC Traces - William Kennedy
Garbage Collection In Go : Part III - GC Pacing - William Kennedy
Go memory ballast: How I learnt to stop worrying and love the heap - Ross Engers
GopherCon 2015: Ben Johnson - Static Code Analysis Using SSA
package ssa
Understanding Compiler Optimization
Debugging code generation in Go - JBD
Pass by Value (Go Playground)
Sharing data I (Go Playground)
Sharing data II (Go Playground)
Escape Analysis (Go Playground)
Stack grow (Go Playground)
Indirect Assignment
Indirection Execution
Assignment Slices Maps
Indirection Level Interfaces
Unknown
Part A Declare and initialize a variable of type int with the value of 20. Display the address of and value of the variable.
Part B Declare and initialize a pointer variable of type int that points to the last variable you just created. Display the address of , value of and the value that the pointer points to.
Template (Go Playground) | Answer (Go Playground)
Declare a struct type and create a value of this type. Declare a function that can change the value of some field in this struct type. Display the value before and after the call to your function.
Template (Go Playground) | Answer (Go Playground)
All material is licensed under the Apache License Version 2.0, January 2004.