String COW?

From: Henrik Nordstrom <henrik_at_henriknordstrom.net>
Date: Wed, 21 Jan 2009 13:07:54 +0100

Still reading the IRC meeting notes regarding String/Buffer, and I
stubled across COWs.. Had forgot we has such beasts flying around in the
Sting/Buffer discussion.

in what context do we need COW? We very very rarely modify anything. We
copy lots of crap around just for the sake of copying, and making
strings null terminated (either in-place or by copying, doesn't really
matter).

With String being backed by a refcounted store copying is eleminated.

In the rare cases that the strings really need to be modified then a
copy in a structured manner is needed. And is imho best done by a
explicit interface.

Regards
Henrik
Received on Wed Jan 21 2009 - 12:08:04 MST

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