3 ms·
I’ve never heard of C function “ownership”. What does it mean?
by l33t2328 5y ago
I’ve never heard of C function “ownership”. What does it mean?
- pjc50 5y agoPointers passed in and out have a very important property that's critical for writing secure reliable programs but is not encoded anywhere in the language, and that is lifetime and ownership. If you pass a pointer to a function, will it free() it? Or store it somewhere where it will later free it? Can you now free it yourself safely or not? Same applies to returned pointer values: don't free or must free?
- deleted 5y ago[deleted]