From 24f410430b33aaf1f288b83ea37e18fa959e9d3e Mon Sep 17 00:00:00 2001 From: _ov4 Date: Tue, 27 Oct 2026 13:30:54 +0000 Subject: docs(memory): describe standard-library allocation and explicit imports Co-Authored-By: Claude Opus 5.5 --- AGENTS/PITFALLS/modules-and-stdlib.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'AGENTS/PITFALLS') 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. -- cgit v1.3.1-4-g156e