Skip to content

Commit

Permalink
builtin: cleanup comments of struct string
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Sep 4, 2024
1 parent 0090170 commit 59f9429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/builtin/string.v
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ pub struct string {
pub:
str &u8 = 0 // points to a C style 0 terminated string of bytes.
len int // the length of the .str field, excluding the ending 0 byte. It is always equal to strlen(.str).
mut:
is_lit int
// NB string.is_lit is an enumeration of the following:
// .is_lit == 0 => a fresh string, should be freed by autofree
// .is_lit == 1 => a literal string from .rodata, should NOT be freed
// .is_lit == -98761234 => already freed string, protects against double frees.
// ---------> ^^^^^^^^^ calling free on these is a bug.
// Any other value means that the string has been corrupted.
mut:
is_lit int
}

// runes returns an array of all the utf runes in the string `s`
Expand Down

0 comments on commit 59f9429

Please sign in to comment.