MCPcopy Create free account
hub / github.com/dustinxie/lockfree / NewStack

Function NewStack

list/stack.go:30–35  ·  view source on GitHub ↗

NewStack creates a new stack

()

Source from the content-addressed store, hash-verified

28
29// NewStack creates a new stack
30func NewStack() *stack {
31 var empty interface{}
32 return &stack{
33 head: &node{val: unsafe.Pointer(&empty)},
34 }
35}
36
37func (s *stack) Len() int {
38 return int(atomic.LoadUint64(&s.count))

Callers 2

NewStackFunction · 0.92
TestStackFunction · 0.70

Calls

no outgoing calls

Tested by 1

TestStackFunction · 0.56