I am in the same field as Adrian on this. Do not implement consume
operation where data is actually moved.

When reading from network, part of a memory area is consumed. When it's
full a new area is allocated and the old is forgotten (will get
deallocated when the refcounts held by String:s to that area go away).

consume() of a writeable string is better done as a substr operation,
creating a new String containing the tail, replacing the original. It's
a new offset,length pair within the same memory region.

Regards
Henrik

Reply via email to