strbuf 0.3.0 is out. Since 0.2.1 the compiler deletes buffers for us (implements delete), and 0.3.0 adds into-string, which consumes a buffer and hands its allocation to the returned String without copying.
Copy-then-free sites, each of which becomes a single (StringBuf.into-string sb):
http-client.carp:523-524 — header accumulation in the receive loop
http-client.carp:807-808 — drain-stream
src/cookie-jar.carp:201-202
src/multipart.carp:208
Plain scope-end deletes that can just go away, since the buffer is freed at scope exit:
bench/string-accumulate.carp:48, 66 — worth a look rather than a blind delete: if the benchmark is meant to measure the create/append/free cycle, keeping the explicit call is defensible, but then it is measuring something the library no longer asks users to do
Pins to bump to strbuf@0.3.0: http-client.carp:4, bench/string-accumulate.carp:2.
Nothing breaks if this waits: manual delete is still an ownership transfer and does not double free.
strbuf 0.3.0 is out. Since 0.2.1 the compiler deletes buffers for us (
implements delete), and 0.3.0 addsinto-string, which consumes a buffer and hands its allocation to the returnedStringwithout copying.Copy-then-free sites, each of which becomes a single
(StringBuf.into-string sb):http-client.carp:523-524— header accumulation in the receive loophttp-client.carp:807-808—drain-streamsrc/cookie-jar.carp:201-202src/multipart.carp:208Plain scope-end deletes that can just go away, since the buffer is freed at scope exit:
bench/string-accumulate.carp:48,66— worth a look rather than a blind delete: if the benchmark is meant to measure the create/append/free cycle, keeping the explicit call is defensible, but then it is measuring something the library no longer asks users to doPins to bump to
strbuf@0.3.0:http-client.carp:4,bench/string-accumulate.carp:2.Nothing breaks if this waits: manual
deleteis still an ownership transfer and does not double free.