From 218d6c6b4d7437c7c838ea8a0b8e18761bca6c4a Mon Sep 17 00:00:00 2001 From: antono2 Date: Fri, 6 Nov 2026 23:03:33 +0100 Subject: [PATCH] docs: explain mapped-byte helper compatibility scope --- examples/buffer_suballocation/mapped_bytes.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/buffer_suballocation/mapped_bytes.v b/examples/buffer_suballocation/mapped_bytes.v index 0925271..f4cb4f8 100644 --- a/examples/buffer_suballocation/mapped_bytes.v +++ b/examples/buffer_suballocation/mapped_bytes.v @@ -1,7 +1,8 @@ module main -// Pass the pointer value into a fresh local scope: vlang/v#31481 otherwise -// casts a heap-promoted voidptr slot's address instead of its stored value. +// 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. fn store_mapped_byte(mapped voidptr, value u8) { unsafe { *(&u8(mapped)) = value