You said it yourself:
While I preferred avoiding dynamically allocating memory, as it was much less risky, there were certainly times it just made sense or was the only way.
This is not a common attitude to have outside of embedded and similar areas. Most programmers dynamically allocate memory without a second thought and not as a last resort. Python is one of the most popular programming languages, but how often do you see Python code that is capable of running without allocating memory at runtime?
owenfromcanada@lemmy.world 10 months ago
I’d effectively gain the advantage of dynamic allocation by using a union (or just a generic
unsigned char buffer[16384]
and use it twice). Mostly the same thing as a malloc.