3min chapter

Go Time: Golang, Software Engineering cover image

A deep dive into Go's stack

Go Time: Golang, Software Engineering

CHAPTER

How to Control What Goes on the Stack

When you create a local variable, for instance, it's going to be on the stack or when you pass an argument to a function, it's probably on the end of the stack. The place where this kind of gets complicated is that what's not on the stack, which is things that are on the heap. And so overall, the general idea is put as much things on the stack because the stack, as David said, is scratch storage. It does not need the garbage collector. Only if you need to use pointers and only if you need something on the heap, you'll do that just to avoid the overhead of the garbage collector running.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode