Hi,
I’m migrating from flexstr 0.9.2 to 0.11.0 and noticed a couple of regressions related to formatting and inline storage size.
- Removal of
shared_ufmt/local_ufmt
In 0.9.2 there was a method shared_ufmt, which (as I understood and relied on) allowed formatting into SharedStr without heap allocation, as long as the resulting string fit into the inline buffer.
In 0.11.0, shared_ufmt no longer exists, and I can’t find an alternative way to format directly into SharedStr while avoiding heap allocation for short strings.
Question:
What is the recommended way in 0.11.0 to format into SharedStr without using the heap, when the formatted string is short enough to fit inline?
- Inline string size is no longer configurable
In older versions it was possible to control the inline buffer size by defining a custom type, for example:
type BigInlineStr = FlexStr<64, /* other params */>;
This was very useful for performance-critical code where stack-only storage is important.
In 0.11.0, the inline size appears to be hardcoded inside the library, and users can no longer choose a custom inline capacity.
Question:
Is this an intentional design decision?
If so, what is the recommended approach for users who need a larger inline buffer and want to avoid heap allocations?
Hi,
I’m migrating from flexstr 0.9.2 to 0.11.0 and noticed a couple of regressions related to formatting and inline storage size.
shared_ufmt/local_ufmtIn 0.9.2 there was a method shared_ufmt, which (as I understood and relied on) allowed formatting into SharedStr without heap allocation, as long as the resulting string fit into the inline buffer.
In 0.11.0, shared_ufmt no longer exists, and I can’t find an alternative way to format directly into SharedStr while avoiding heap allocation for short strings.
Question:
What is the recommended way in 0.11.0 to format into SharedStr without using the heap, when the formatted string is short enough to fit inline?
In older versions it was possible to control the inline buffer size by defining a custom type, for example:
type BigInlineStr = FlexStr<64, /* other params */>;
This was very useful for performance-critical code where stack-only storage is important.
In 0.11.0, the inline size appears to be hardcoded inside the library, and users can no longer choose a custom inline capacity.
Question:
Is this an intentional design decision?
If so, what is the recommended approach for users who need a larger inline buffer and want to avoid heap allocations?