Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/buffer_suballocation/mapped_bytes.v
Original file line number Diff line number Diff line change
@@ -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
Expand Down