aboutsummaryrefslogtreecommitdiff
path: root/AGENTS/PITFALLS/modules-and-stdlib.md
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-27 13:30:54 +0000
committer_ov4 <ov4@ov4.org>2026-10-27 13:30:54 +0000
commit24f410430b33aaf1f288b83ea37e18fa959e9d3e (patch)
tree1f10b4ad2fae28a54064be270de70454343a4d64 /AGENTS/PITFALLS/modules-and-stdlib.md
parent0dd0b0908300eee08a06ee51d9eb48b85fd97d74 (diff)
docs(memory): describe standard-library allocation and explicit imports
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'AGENTS/PITFALLS/modules-and-stdlib.md')
-rw-r--r--AGENTS/PITFALLS/modules-and-stdlib.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/AGENTS/PITFALLS/modules-and-stdlib.md b/AGENTS/PITFALLS/modules-and-stdlib.md
index 4f6c446..5394d78 100644
--- a/AGENTS/PITFALLS/modules-and-stdlib.md
+++ b/AGENTS/PITFALLS/modules-and-stdlib.md
@@ -13,11 +13,15 @@ Part of the [pitfalls index](../PITFALLS.md).
- GLOBAL accepts only the five primitive scalar types and literal initializers;
arrays, user types and computed initializers are rejected.
- Own top-level constants remain positional, imported constants do not.
-- **Default standard library.** std.cps and its imported STRING library are embedded
+- **Default standard library.** std.cps and its imported STRING and memory libraries are embedded
and automatically linked.
- Use -no-std before explicitly supplying a replacement STRING class/library;
otherwise duplicate definitions fail.
- Ordinary literals require a visible STRING class with NEW(C_STRING).
- C_TYPE/INCLUDE/EXTERN syntax strings are parser metadata and do not construct
STRING.
- - -S emits IR only; manual linking needs string.o and the C++ runtime.
+ - Keyword NEW/DELETE and MALLOC/REALLOC/FREE require memory.cps; -no-std users
+ must explicitly import it. Ordinary constructor/destructor methods still work
+ without it.
+ - -S emits IR only; default-library manual linking needs string.o, memory.o and
+ the C++ runtime.