#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sun, 12 Feb 2017 23:39:52 +0100
changeset 21409 c405d6641c96
parent 21408 e641024561c6
child 21410 660679622f0c
#FEATURE by cg class: ExternalLibraryFunction class definition added: #mustFreeReturnValue new flag: mustFree
ExternalLibraryFunction.st
--- a/ExternalLibraryFunction.st	Sun Feb 12 21:53:49 2017 +0100
+++ b/ExternalLibraryFunction.st	Sun Feb 12 23:39:52 2017 +0100
@@ -19,7 +19,7 @@
 		CALLTYPE_UNIX64 CALLTYPE_V8 CALLTYPE_V9 DLLPATH DllMapping
 		FLAG_ASYNC FLAG_NONVIRTUAL FLAG_OBJECTIVEC FLAG_RETVAL_IS_CONST
 		FLAG_UNLIMITEDSTACK FLAG_VIRTUAL LastModuleHandleHolder
-		LastModuleHandleName Verbose'
+		LastModuleHandleName Verbose FLAG_RETVAL_MUST_FREE'
 	poolDictionaries:''
 	category:'System-Support'
 !
@@ -775,6 +775,15 @@
     ^ moduleName
 !
 
+mustFreeReturnValue
+    "specify that a pointer to some C-datum is returned, which must be freed by ST/X.
+     (i.e. points to malloc'd data which is NOT freed by c)"
+
+    flags := (flags ? 0) bitOr: FLAG_RETVAL_MUST_FREE.
+
+    "Created: / 12-02-2017 / 23:31:27 / cg"
+!
+
 returnType
     ^ returnType
 !