[racket] Bytes and GC

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Sun Jan 26 00:59:17 EST 2014

> (define a #"abcd")
> (define a0 (cast (cast a _bytes _pointer) _pointer _bytes))
> (eq? a a0)
#f
> (bytes-set! a0 2 33)
> a
#"ab!d"
> (immutable? a)
#t
So I have two different objects with the same pointer. Will garbage collector work correct in this situation? 
I mean, it should see two reference to the same object in memory. 
Or it will try to collect the bytestring when 'a' will become inaccessible?
-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140126/a460d7c8/attachment.html>

Posted on the users mailing list.