Closed AlexRouSg closed 10 months ago
Don't memory allocated within a dynamic library have to also be freed from within said dynamic library due to multiple instances of the C runtime and stuff?
No. Shared libraries share code not data. Each process has its own global, heap and stack data. Call free()
to free returned data. How would you like to see the documentation clarified?
I think I was just overthinking this cause I was used to seeing shared libs with a free function and was expecting to find one. I'll close the issue.
So I noticed there are some functions that say "caller is responsible for freeing it" however it is not clear how is one supposed to free said memory, assuming it means literally calling
free()
, how would that work when libktx is built as a dynamic library?Don't memory allocated within a dynamic library have to also be freed from within said dynamic library due to multiple instances of the C runtime and stuff?