c3-web
c3-web copied to clipboard
Write a page on String, DString, ZString
How to use each, how to use with temporary allocator
coppamocha — Today at 09:36 do we need to free Strings or are they automatically freed. asking this cuz, i tried .free() method and the program aborts: free(): invalid pointer [09:37] is this because maybe the string is allocated on stack? [09:38] if so, is there a way to detect if the string was allocated on stack?
Christoffer L — Today at 10:36 No, you need to know where this String comes from @coppamocha. That is one of the drawbacks of using String. You can use the DString if you want to have something that knows how to free itself.
string.iterator()iterates over codepoints, so you get Char32 back