summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-04-06 00:57:24 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-04-06 00:57:24 -0700
commitc5acd13409cca8f95b7a921efc12ad8833713ffe (patch)
treeef9779d7283bf68f3531e2dc0402f18cdfd267be /txr.1
parent064d4cd974f5e54cb310838eb25e36a6bf83d24d (diff)
downloadtxr-c5acd13409cca8f95b7a921efc12ad8833713ffe.tar.gz
txr-c5acd13409cca8f95b7a921efc12ad8833713ffe.tar.bz2
txr-c5acd13409cca8f95b7a921efc12ad8833713ffe.zip
New function: cptr-size-hint.
* eval.c (eval_init): Register cptr-size-hint intrinsic. * lib.c (cptr_size_hint): New function. * lib.h (cptr_size_hint): Declared. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.120
1 files changed, 20 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index ddaac786..697ff1bd 100644
--- a/txr.1
+++ b/txr.1
@@ -59882,6 +59882,26 @@ The expression
.code "(cptr-int 0)"
also produces a null pointer on all platforms where \*(TX is found.
+.coNP Function @ cptr-size-hint
+.synb
+.mets (cptr-size-hint < cptr << bytes )
+.syne
+.desc
+The
+.code cptr-size-hint
+function indicates to the garbage collector that the given
+.meta cptr
+object is associated with
+.meta bytes
+of foreign memory that are otherwise invisible to the garbage collector.
+
+Note: this function should be used if the foreign memory is indirectly
+managed by the
+.meta cptr
+object in cooperation with the garbage collector. Specifically,
+.meta cptr
+should have a finalizer registered against it which will liberate the
+foreign memory.
.SH* FOREIGN FUNCTION INTERFACE