[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Comparing String with Symbol

Yukihiro Matsumoto

5/8/2008 3:50:00 PM

Hi,

In message "Re: Comparing String with Symbol"
on Fri, 9 May 2008 00:43:19 +0900, Roger Pack <rogerpack2005@gmail.com> writes:

|I'd use either one except that [quoting Tim Harper]
|
|once a symbol is allocated, it is never garbage collected.
|
|This opens up a potential DOS attack: if you convert any user input to
|symbols (via #to_sym or #intern), they could easily fill your symbol
|space up and eat all of the available system memory.

That's true but there are some other ways for potential DOS attack,
which I don't disclose here. So you don't have to worry too much.

Anyway, I have a plan to make Symbol garbage collected in 1.9 near
future.

matz.