March 2019
Intermediate to advanced
336 pages
9h 9m
English
The following code snippet shows how references to created objects are maintained in the stack. The ReferenceCounter class has the number of references, including the pool of references and removed references, as properties:
//main package has examples shown// in Hands-On Data Structures and algorithms with Go bookpackage main// importing fmt packageimport ( "fmt" "sync")//Reference Countertype ReferenceCounter struct { num *uint32 pool *sync.Pool removed *uint32}
Let's take a look at the method of the ReferenceCounter class.
Read now
Unlock full access