I am working on a C-Ada binding application, where I am allocating a new string in Ada side using Interfaces.C.Strings.New_String().
Interfaces.C.Strings already has a procedure Free() to deallocate the memory for string. Since I need to pass this string to a C function using Interfaces.C.Strings.Chars_Ptr:
Is it OK if I deallocate memory for the string in C side using the
free()function (declared in stdlib.h)?Is it safe if I free the memory from C side?
Or I should better free it using the
Interfaces.C.Strings.Free()function from Ada side?