aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function/cpsc-function-malloc.7.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-20 01:31:47 +0000
committer_ov4 <ov4@ov4.org>2026-10-20 01:31:47 +0000
commit1ed0e276a37d39386b22b08c1f9e575a8f8f8725 (patch)
tree4662810e9a9c23e3af81ad3aea80594ab91cf1df /doc/language/function/cpsc-function-malloc.7.md
parent81e18a089ccc5ef4869d6b5a53f49e4696d33dd7 (diff)
docs(man): correct class lifetime and allocation support
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function/cpsc-function-malloc.7.md')
-rw-r--r--doc/language/function/cpsc-function-malloc.7.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/language/function/cpsc-function-malloc.7.md b/doc/language/function/cpsc-function-malloc.7.md
index c0ca1a6..077e17f 100644
--- a/doc/language/function/cpsc-function-malloc.7.md
+++ b/doc/language/function/cpsc-function-malloc.7.md
@@ -14,9 +14,9 @@ MALLOC(bytes)
MALLOC is a compiler extension returning a C `void*` to the beginning of an uninitialized allocation. The size is in bytes and accepts INTEGER or a C integer, converted to the host size_t using C integer conversion rules. Negative values are not separately rejected. MALLOC(0) returns null without allocating. A nonzero allocation failure prints the source line and reason to stderr, then throws an anonymous exception catchable with TRY/CATCH. Allocation tracking failures behave the same way.
-Declare a `void*` alias with C_TYPE and explicitly cast the result to a C or pseudocode pointer before dereferencing. MALLOC does not initialize fields or call constructors; it is unrelated to the CIE class NEW construct. The caller must supply enough bytes and initialize values before reading them. User memory is not automatically released.
+Declare a `void*` alias with C_TYPE and explicitly cast the result to a C or pseudocode pointer before dereferencing. MALLOC does not initialize fields or call constructors. Keyword NEW uses the same tracked allocation path, then initializes and constructs the class object. The caller of MALLOC must supply enough bytes and initialize values before reading them. User memory is not automatically released.
-Only allocations from explicit memory builtins are tracked. Internal STRING and ARRAY buffers remain outside this ownership system. Tracking validates FREE/REALLOC addresses, not memory accesses, bounds or stale aliases after address reuse.
+Explicit MALLOC/REALLOC and keyword NEW allocations are tracked. Internal STRING and ARRAY buffers remain outside this ownership system. Tracking validates FREE, REALLOC and keyword DELETE addresses, not memory accesses, bounds or stale aliases after address reuse.
# EXAMPLE