Re:Never create Ruby strings longer than 23 characters
by pedrocr on Wednesday December 11, 2013 @10:43AM
(#6888141)
According to the article both str and str2 will point to the same char[] on the heap, but they are represented by two different RString objects. As you said when you want to access str and str2 you need to look them up in a table. So why not have both entries on the table point to the same RString, instead of pointing to two different RString's that point to the same char[]?
[ Parent
| on HN ]
Re:Never create Ruby strings longer than 23 characters
by alecdbrooks on Wednesday December 11, 2013 @10:57AM
(#6888232)
I'm sorry, I misunderstood your question. Apparently what you describe is actually the case, as the link posted by danieldk below describes.