From 43b51a985f11b557abbe486b6ff3d32c83582d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 1 Feb 2024 20:05:15 +0100 Subject: [PATCH] manual: rewrite confusing section in the documentation --- src/doc/manual/extensions/ffi.txi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/doc/manual/extensions/ffi.txi b/src/doc/manual/extensions/ffi.txi index e0287b7b0..d07056d85 100644 --- a/src/doc/manual/extensions/ffi.txi +++ b/src/doc/manual/extensions/ffi.txi @@ -196,9 +196,14 @@ This function returns a C pointer for the given Lisp foreign object. Lisp foreign objects are constructed with functions @code{ecl_make_foreign_data} and @code{ecl_allocate_foreign_data}. -This data is a subject of the garbage collection (unlike lisp functions like -@code{si:allocate-foreign-object}). This is because the data producer here is -the "C world" and the data consumer is the "Lisp world". +The wrapper created with @code{ecl_make_foreign_data} is a subject of +garbage collection, but the pointer itself is not ``freed'', because +the data producer is ``C world'' and the consumer is ``Lisp world''. + +This is different from @code{si:allocate-foreign-object} where the +data producer is ``Lisp world'' and the consumer is ``C world''. In +this case the wrapper is not collected unless explicitly freed, and in +that case the allocate foreign data is also released. @end deftypefun @cppdef ecl_base_string_pointer_safe