Package: glib

Type g-string

Details

A type that is almost like the foreign CFFI :string type but uses the GLib g-malloc and g-free functions to allocate and free memory.

The g-string type performs automatic conversion between Lisp and C strings. Note that, in the case of functions the converted C string will have dynamic extent, i.e. it will be automatically freed after the foreign function returns.

In addition to Lisp strings, this type will accept foreign pointers and pass them unmodified.

A method for free-translated-object is specialized for this type. So, for example, foreign strings allocated by this type and passed to a foreign function will be freed after the function returns.
 

See also

2021-12-10