You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently implement these via String.explode and String.implode, but should instead iterate and build a new string. We probably don't want to make String depend on Buffer, but we could guess the next string size and realloc/copy if necessary.
The text was updated successfully, but these errors were encountered:
We currently implement these via String.explode and String.implode, but should instead iterate and build a new string. We probably don't want to make String depend on Buffer, but we could guess the next string size and realloc/copy if necessary.
Instead of using a buffer for this would we be able to allocate a string of size 4*charCount which is the max bytesize the output string could be and, do the mapping and then shrink the strings bytelength to the real size without doing a realloc? This wouldn't hurt memory allocation in any way right but it would mean strings use more memory then they need beause we cant free a portion of a block right? I think this would be way more efficent then a buffer as it means we can do one alloc and write the characters directly to the string without needing any copying. Though it might result in a lot of wasted memory space if you are mapping large strings.
We currently implement these via
String.explode
andString.implode
, but should instead iterate and build a new string. We probably don't want to makeString
depend onBuffer
, but we could guess the next string size and realloc/copy if necessary.The text was updated successfully, but these errors were encountered: