:: krowemoh

Saturday | 28 DEC 2024
Posts Links Other About Now

previous
next

C Programming

2022-02-14

Now that I'm working on more C code and adding more functions to my universe wrapper library, I'm starting to see how handling memory can be a giant pain in the ass. I have a feeling I'm going to forget to free some piece of memory leading to leaks or a double free which I know what it is, but don't know why it's dangerous.

C definitely forces you to think and I can see how it's giving me enough rope to hurt myself. It'll be fun to come back in the future and see what holes I find.

I am trying to make sure I clean up pointers that I allocate and trying to think about what may be a bit weird. But I can already tell that the code is getting too big for me to hold in my head properly.

When I was working on just the CallSubroutine function, things were straightforward and relatively sane. Just by adding an extra function to do Reads was enough to force me to start boxing things up and stop taking a holistic view while coding.