Find the perfect coding resourcesLearn more

Learn Memory Management in C

Boot.devBoot.dev
Recommended
Meet Your Instructor
TJ DeVries avatar

TJ DeVries

Instructor

TJ DeVries (aka "teej") has never worked at Netflix, but if you've heard of Neovim, well, he's a maintainer! It's really not a big deal. He's also a top telescope.nvim contributor and knows how to read, which is impressive. He used to work at Sourcegraph before becoming a full time coding educator and content creator.

24 hours

Completion

Certificate included

Format

Interactive coding

Freemium

What You'll Learn

Manually manage memory in C to optimize application performance

Build a stack data structure using C structs and pointers

Implement a reference counting garbage collector from scratch

Create a mark and sweep garbage collector and understand its tradeoffs

Master the use of pointers and advanced pointer concepts in C

Overview

Memory management is something that every programmer needs to deal with and understand at some point. If you're used to working with languages and tools that handle it for you, this course will teach you how all that works under the hood. You'll even build your own garbage collectors from scratch. This course will teach you the C basics you need for the course, but it's not a course about C, it's about memory.

Table of Contents
1
C Basics

Introduction to the basics of the C programming language

2
Structs

Understand how C structs work and how they're laid out in memory

3
Pointers

You thought pointers were hard? Wrong. Let's figure them out together.

4
Enums

Learn how to use enums (enumerations) in C to create a set of named constants.

5
Unions

Unions in C are not the same as they are in TypeScript. Let's grok C unions.

6
Stack and Heap

Understand the difference between allocating memory on the stack and the heap

7
Advanced Pointers

Let's practice some more advanced pointer concepts - like pointers to pointers

8
Stack Data Structure

Build a stack in C using structs and pointers and understand where the memory is allocated

9
Objects

Implement your own object system for later use in your garbage collection algorithms

10
Refcounting GC

Implement a simple reference counting garbage collector from scratch in C

11
Mark and Sweep GC

Implement a basic mark and sweep garbage collector and understand its tradeoffs with refcounting

Share Your Experience

Sign in to leave a review and help others

No reviews yet. Be the first to review!