O'Reilly logo

Hands-On System Programming with Linux by Kaiwan N Billimoria

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What is stack memory?

You probably remember being taught that stack memory is just memory but with a special push/pop semantic; the memory you push last resides at the top of the stack, and if you perform a pop operation, that memory gets popped off – removed from – the stack.

The pedagogical example of visualizing a stack of dinner plates is a good one: the plate you place last is at the top, and you take the top plate off to give it to your dinner guest (of course, you could insist that you give them the plate from the middle or bottom of the stack, but we think that the plate on the very top would be the easiest one to pop off).

Some literature also refers to this push/pop behavior as Last In First Out (LIFO). Fair enough.

The high end ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required