Relative Content

Tag Archive for malloc

How many `malloc` calls is too many? If any?

I’m implementing a system in C, implemented partially as a library. The library does most of the memory management itself, with the application layer just having to call *_destroy functions on the top-level objects.

Functions returning strings, good style?

In my C programs I often need a way to make a string representation of my ADTs. Even if I don’t need to print the string to screen in any way, it is neat to have such method for debugging. So this kind of function often comes up.