Below the API

Data in Memory

BasicModule6 topics~5h
completed

Topics, in order

About this module

Module I said slices, strings, maps and interfaces are “small headers that point elsewhere”. This module draws each header, byte by byte, and shows what follows from the drawing.

#LessonThe question it answers
01Arrays and SlicesWhat is a slice, and when do two slices share memory?
02Strings, Bytes and RunesWhat is a string made of, and what does converting it cost?
03MapsHow does a map find a key, and what does it cost in memory?
04Pointers and Struct LayoutHow are fields arranged, and why does field order change a struct’s size?
05Interfaces Under the HoodWhat is inside an interface value, and when is nil not nil?
06Generics and IteratorsHow do type parameters work, and what do they cost?

When you finish you can draw any Go value as boxes and arrows, say how many bytes it occupies, and predict whether an operation copies, shares or allocates.

↑↓ navigate ↵ open