O'Reilly logo

C by Nikolaos D. Tselikas, George S. Tselikis

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

Chapter 14

Memory Management and Data Structures

Memory management is mainly related to memory allocation and the release of allocated memory when it is no longer needed. Memory allocation can be performed either statically or dynamically. Up to this point, our program variables are stored in fixed size memory, statically allocated. In this chapter, we’ll show you how to allocate memory dynamically during program execution in order to form flexible data structures, like stacks, queues, and linked lists.

Memory Blocks

When a program runs, it asks for memory resources from the operating system. Various operating systems and compilers use their own models to manage the available memory. Typically, the system memory is divided into four parts:

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