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
liquid-rust version:
rust version: 1.66.1
OS: Linux (Debian)
If I want to create a KString from a number, I have to do: KString::from(123.to_string());
The problem with this code, is that it will create a String (which will always allocate memory) and then it will create a new KString out of that initial String, and so I guess that allocated memory will be destroyed if the resulting string from that number is small enough.
There is a way to avoid this memory allocation+deallocation, passing through a String, and having maybe some From and so on, which in turn will have a stack buffer so big to contain all integer/floats, so if the number fits in a KString without any allocation fine, otherwise it will allocate new memory for bigger numbers?
The text was updated successfully, but these errors were encountered:
liquid-rust version:
rust version: 1.66.1
OS: Linux (Debian)
If I want to create a KString from a number, I have to do:
KString::from(123.to_string());
The problem with this code, is that it will create a
String
(which will always allocate memory) and then it will create a newKString
out of that initialString
, and so I guess that allocated memory will be destroyed if the resulting string from that number is small enough.There is a way to avoid this memory allocation+deallocation, passing through a
String
, and having maybe some From and so on, which in turn will have a stack buffer so big to contain all integer/floats, so if the number fits in aKString
without any allocation fine, otherwise it will allocate new memory for bigger numbers?The text was updated successfully, but these errors were encountered: