aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function/cpsc-function-free.7.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 08:38:02 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 08:38:02 +0000
commit5097edca0619007eb4237e52fcc07f0e0b4b99e2 (patch)
tree36f1e4bbde5e087d4932aaa813989bf4407f78f4 /doc/language/function/cpsc-function-free.7.md
parent6a3b31af5dbb22749e6d5a1cad9dfaab6863b615 (diff)
docs(classes): document destructors, DELETE and RAII
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function/cpsc-function-free.7.md')
-rw-r--r--doc/language/function/cpsc-function-free.7.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/language/function/cpsc-function-free.7.md b/doc/language/function/cpsc-function-free.7.md
index e2c8f12..61a3558 100644
--- a/doc/language/function/cpsc-function-free.7.md
+++ b/doc/language/function/cpsc-function-free.7.md
@@ -12,11 +12,11 @@ FREE(pointer)
# DESCRIPTION
-FREE is a compiler extension. Its argument and return type are C `void*`. Explicitly cast other pointer types to a `void*` alias before passing them. A null pointer is accepted and returned. A non-null pointer must be the start of an active explicit MALLOC or REALLOC allocation; internal STRING/ARRAY storage, stack addresses, interior addresses and already released allocations are rejected with a source-line diagnostic on stdout and an anonymous exception.
+FREE is a compiler extension. Its argument and return type are C `void*`. Explicitly cast other pointer types to a `void*` alias before passing them. A null pointer is accepted and returned. A non-null pointer must be the start of an active explicit MALLOC, REALLOC or keyword NEW allocation; internal STRING/ARRAY storage, stack addresses, interior addresses and already released allocations are rejected with a source-line diagnostic on stdout and an anonymous exception.
FREE returns its input address after releasing the allocation. It does not clear the caller's variable. The returned address and all aliases are invalid for memory access. Calling FREE again on that address throws unless a subsequent allocation has reused the address. Tracking cannot distinguish stale aliases once an address is reused.
-The result can be discarded with a standalone call. No user destructor is called.
+The result can be discarded with a standalone call. No user destructor is called. Use keyword DELETE on a class object to destroy it and its fields before releasing its allocation.
# EXAMPLE
@@ -29,4 +29,4 @@ FREE(Memory)
# SEE ALSO
-[cpsc-function-malloc(7)](cpsc-function-malloc.7.md), [cpsc-function-realloc(7)](cpsc-function-realloc.7.md), [cpsc-keyword-function(7)](../keyword/cpsc-keyword-function.7.md), [cpsc-keyword-try(7)](../keyword/cpsc-keyword-try.7.md).
+[cpsc-keyword-delete(7)](../keyword/cpsc-keyword-delete.7.md), [cpsc-function-malloc(7)](cpsc-function-malloc.7.md), [cpsc-function-realloc(7)](cpsc-function-realloc.7.md), [cpsc-keyword-function(7)](../keyword/cpsc-keyword-function.7.md), [cpsc-keyword-try(7)](../keyword/cpsc-keyword-try.7.md).