[racket] ffi, unioun, string: is this correct?

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Sun Sep 1 09:38:26 EDT 2013

 (define _giarg (_union _bool _int8 _uint8 _int16 _uint16
                       _int32 _uint32 _int64 _uint64
                       _float _double _long _ulong _pointer _string))

(define giarg (malloc _giarg)) (ptr-set! giarg _string "Test string")

---

It works. But I'm afraid, that string maybe allocated temporary and will be GC'ed at any time. Or _union keep _string pointer inside?


-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130901/7e6b98fd/attachment.html>

Posted on the users mailing list.