Hi,

In message "Memory behavior of String#dup"
    on 03/06/30, "Robert Klemme" <bob.news / gmx.net> writes:

|does String#dup also copy the byte sequence of the string or does it only
|copy a reference and does a copy on write?

When memory is already shared between strings, it does copy-on-write,
otherwise it copies.  From my observation, many of duped strings are
modified right after the dup, so that I felt it is wise to avoid
making new internal copy-on-write entries for duping.

							matz.