String consume method

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Wed, 21 Jan 2009 11:52:03 +0100

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
Received on Wed Jan 21 2009 - 10:52:17 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 21 2009 - 12:00:26 MST