From 4405730e585167eb4f19f04afad68dfebe66dcd7 Mon Sep 17 00:00:00 2001 From: antono2 Date: Thu, 12 Nov 2026 21:13:23 +0100 Subject: [PATCH] docs: explain mapped-byte compatibility on stable V --- examples/buffer_suballocation/mapped_bytes.v | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/buffer_suballocation/mapped_bytes.v b/examples/buffer_suballocation/mapped_bytes.v index f4cb4f8..8b76e6a 100644 --- a/examples/buffer_suballocation/mapped_bytes.v +++ b/examples/buffer_suballocation/mapped_bytes.v @@ -1,8 +1,10 @@ module main -// Keep this helper for compatibility with older V3 compilers (vlang/v#31481). -// Passing the pointer value into a fresh scope prevents a heap-promoted -// pointer slot from being used as the byte-store destination. +// Keep this helper for older V3 compilers affected by vlang/v#31481. +// Newer V3 fixes that issue, but stable V 0.5.2 still fails its escaping-pointer +// reproducer, even though this example passes without the helper. Passing the +// pointer value into a fresh scope keeps byte stores directed at mapped memory +// instead of a heap-promoted pointer slot. fn store_mapped_byte(mapped voidptr, value u8) { unsafe { *(&u8(mapped)) = value