~ chicken-core (master) f3457a3429409d115f978941724053998d27b8a1
commit f3457a3429409d115f978941724053998d27b8a1
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Wed Sep 23 23:40:04 2026 +0200
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Wed Sep 23 23:40:04 2026 +0200
fix missing allocation demand for strings, even when allocated statically.
The new string representation must take the wrapper structure into account,
even when the actual bytevector resides in static memory. In the old way,
the whole string, including header, could be allocated statically.
diff --git a/c-backend.scm b/c-backend.scm
index fe692db3..e72ba7c4 100644
--- a/c-backend.scm
+++ b/c-backend.scm
@@ -740,7 +740,7 @@
(define (literal-size lit)
(cond ((immediate? lit) 0)
((big-fixnum? lit) 2) ; immediate if fixnum, bignum see below
- ((string? lit) 0) ; statically allocated
+ ((string? lit) 5) ; statically allocated (bytevector only)
((bignum? lit) 2) ; internal vector statically allocated
((flonum? lit) words-per-flonum)
((symbol? lit) 7) ; size of symbol, and possibly a bucket
Trap