#Replacement for ArrayList.fixedWriter

1 messages · Page 1 of 1 (latest)

serene turret
#

I'm confused, what is the replacement for std.array_list.Managed(u8).fixedWriter? My usecase is that I'm trying to convert an integer to a string in a loop but I know the max length of the string on each iteration of the loop, so I'm clearing the list and then reserving that amount before converting to the string

weak flicker
#

actually std.Io.Writer.Allocating prob better

#

depends on your setups

serene turret
#

Does Allocating support a clear operation? (without unallocating)

serene turret
#

Hm that's probably good enough for now

#

Even though it could reallocate

serene turret
#

ya but in theory the print function could reallocate even though it never will

#

but at this point I think that's more effort than it's worth to fix

delicate flare
#

if you dont want to allocate use fixed, you can use consume to reset it.

errant scroll
#

i think he wants to be able to reallocate if needed, but only at the start of each loop

#

which Allocating is perfect for :)