Do you program professionally now or develop apps etc?
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
I've had to learn 95% of everything on the job over the past 4 years. I spend most of my free time trying to make apps in Haskell.
I'm currently working on a Haskell-based renderer but right now I'm building a web-based app for synchronising multiple stakeholders and providing clear chains of responsibility as learning exercises.
I didn't watch the video -- and YT isn't letting me speed-read a transcript? -- but generally speaking, if you have a need for memory that isn't backed by the filesystem, and you're writing in C, just use malloc. It's designed for that purpose, although malloc might very well be calling to mmap to obtain an anonymous mapping under the hood. Even if you're going to hold on to memory for the entire lifetime of a program, still use malloc in C.
If your application does need some filesystem backing, or if you're allocating enough memory that hugepages might be reasonable, then that's when you'd want to use mmap.