3 ms·
I don't think there is something inheritantly wrong with a lib allocating on your behalf. Most non-trivial problems require memory allocation, and if you have
by nteon 13y ago
I don't think there is something inheritantly wrong with a lib allocating on your behalf. Most non-trivial problems require memory allocation, and if you have a struct that has dynamically allocated fields (like char*'s of data derived from files you've read in), often providing a ${structname}_new() and ${structname}_free() pair is less mental overhead than making sure to free certain fields in stack-allocated structs.