aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function/cpsc-function-realloc.7.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/language/function/cpsc-function-realloc.7.md')
-rw-r--r--doc/language/function/cpsc-function-realloc.7.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/language/function/cpsc-function-realloc.7.md b/doc/language/function/cpsc-function-realloc.7.md
index 7b29c45..03c5bef 100644
--- a/doc/language/function/cpsc-function-realloc.7.md
+++ b/doc/language/function/cpsc-function-realloc.7.md
@@ -12,7 +12,7 @@ REALLOC(pointer, bytes)
# DESCRIPTION
-REALLOC is a compiler extension returning C `void*`. The pointer argument must also be C `void*`; explicitly cast other pointer types. The size accepts INTEGER or a C integer and converts to host size_t, just as MALLOC does.
+REALLOC is an extension provided by the memory.cps standard-library unit returning C `void*`. The pointer argument must also be C `void*`; explicitly cast other pointer types. The size accepts INTEGER or a C integer and converts to host size_t, just as MALLOC does.
A null pointer behaves as MALLOC(bytes). A non-null pointer must start an active tracked MALLOC, REALLOC or keyword NEW allocation, even when bytes is zero. Invalid addresses print the source line and reason to stderr and throw an anonymous exception before touching the memory or allocation record. Resizing or releasing memory with REALLOC does not invoke constructors or destructors.
@@ -20,6 +20,8 @@ For a valid pointer and zero bytes, REALLOC releases the block and returns null.
On nonzero allocation failure, REALLOC prints the source line and reason and throws an anonymous exception. The original allocation and its tracking record remain valid. In `p <- REALLOC(p, bytes)`, assignment occurs only on success, so a CATCH handler can still use or release the old p. A successful resize updates the existing record without allocating a new tracking node. Internal STRING/ARRAY buffers cannot be resized with this function.
+The default std.cps imports memory.cps automatically. With **-no-std**, explicitly INCLUDE memory.cps and pass it as a compiler input; its INCLUDE_OBJ links memory.o for native output and execution. Manual linking of saved IR requires the matching library objects and C++ runtime.
+
# EXAMPLE
```text