flâneur — a map of the web's best reading

cohost! - "Basic memory allocators explained in 10 minutes"

cohost.org · saved by 1 readers

its that girl wot make code do bad things. projects: kitsune tails, super bernie world, midboss, coding history, mega68k. you can find my games on itch and Steam There's a lot of crap out there about memory allocators. Try searching for explanations about slab allocators and there'll be a lot of prattling on about OS resources, which is something slab allocators can be used for, but it's not what they are. So I'm going to quickly cover the basics of several simple memory allocators! Bump allocator The bump allocator is the fastest allocator there is. All it does is give you a pointer to where it currently is, then advances the pointer by the requested size. Super simple. It can't free memory however. Bump allocators are useful because you can give them a fixed size chunk to allocate from and then reset them at some point where you know you're done with all the resources. For example, in gamedev you can allocate stuff into it that will only last until the end of the frame, then reset it

its that girl wot make code do bad things. projects: kitsune tails, super bernie world, midboss, coding history, mega68k. you can find my games on itch and Steam There's a lot of crap out there about memory allocators. Try searching for explanations about slab allocators and there'll be a lot of prattling on about OS resources, which is something slab allocators can be used for, but it's not what they are. So I'm going to quickly cover the basics of several simple memory allocators! Bump allocator The bump allocator is the fastest allocator there is. All it does is give you a pointer to where

Explore this link on the map →