~ chicken-core (master) c62b614d810ffd48af7baa150028d4c526bdc081


commit c62b614d810ffd48af7baa150028d4c526bdc081
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Jun 25 14:08:01 2026 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Thu Jun 25 14:08:01 2026 +0200

    increase buffer sizes to avoid some valgrind warnings caused by utf8-decode readahead

diff --git a/library.scm b/library.scm
index 6434cd65..031594ab 100644
--- a/library.scm
+++ b/library.scm
@@ -1793,7 +1793,7 @@ EOF
   (##sys#encoding-hook
     enc
     (lambda (dec _ scan)
-      (let ((buf (##sys#make-bytevector 4))
+      (let ((buf (##sys#make-bytevector 5))
             (rbv! (##sys#slot (##sys#slot p 2) 7))) ; read-bytevector!
         (let loop ((state #f) (i 0))
           (let ((rn (rbv! p 1 buf i)))
@@ -4076,7 +4076,7 @@ EOF
                   (##sys#read-char/encoding
                    p enc
                    (lambda (buf start len dec)
-                     (let ((pb (##sys#make-bytevector len)))
+                     (let ((pb (##sys#make-bytevector (fx+ len 1))))
                        (##core#inline "C_copy_memory_with_offset" pb buf 0 start len)
                        (##sys#setslot p 10 pb)
                        (dec buf start len
Trap