Hi all,

Is there a way, given a pointer address, to get back to the original
object?  I'm thinking specifically of strings here.

irb(main):006:0> str = "hello"
=> "hello"
irb(main):007:0> addr = [str].pack('p*').unpack('l')
=> [43397704]

Is there a way to go from that address back to "hello"?  You can't
simply reverse it:

irb(main):025:0> addr.pack('l').unpack('p*')
ArgumentError: no associated pointer

It was pointed out to me that Ruby uses rb_str_associate and
rb_str_associated behind the scenes with regards to pack('p'), but I'm
also wondering about addresses for strings that weren't obtained via
pack('p*').

Or is this simply impossible?

Thanks,

Dan 


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.