4 ms·
My rule of thumb is to look at application's design and only ever use malloc where there is 1:N (or N:M) relationship between entities. Everything that's 1:1 sh
by rumcajz 9y ago
My rule of thumb is to look at application's design and only ever use malloc where there is 1:N (or N:M) relationship between entities. Everything that's 1:1 should be allocated in a single step.
- areyousure 9y agoYour heuristic sounds interesting. Can you say a little more about which entities and how to determine their relationship? Thanks.
- maccard 9y agoWeve had data that was fixed size but wouldn't fit on the stack.