3 ms·
On pointers - Like a lot of things with C, you need to handle ownership by convention. I generally try to make the actor that created the heap pointer the owne
by Nursie 12y ago
On pointers -
Like a lot of things with C, you need to handle ownership by convention. I generally try to make the actor that created the heap pointer the owner of it and responsible for its destruction - i.e. instead of allocating buffers and handing them back up the chain full of data, pass them down from the requester where possible. If the length is not known at that point, create another routine to calculate it. Using techniques like this, ownership can become easier.
You can do anything with it, but that's half the problem!
And personally I like threads :)