What about (define-lib foo (fun _string -> _void))
(foo "Test") ? Will be the pointer from string "Test" freed? And how to make it retain, if I need to save it on the foreign side? Суббота, 15 июня 2013, 13:29 +02:00 от Laurent <[email protected]>: >You probably want `register-finalizer': >http://docs.racket-lang.org/foreign/foreign_pointer-funcs.html#%28def._%28%28lib._ffi/unsafe..rkt%29._register-finalizer%29%29 > >See also: >http://docs.racket-lang.org/foreign/Allocation_and_Finalization.html > >Regarding the default behavior, I think Racket does not free automatically >what it did not allocate itself. >So the lib you're linking to either has functions to do the >allocation/deallocation, or its doc should say what you need to free yourself. > >Laurent > > >On Sat, Jun 15, 2013 at 12:47 PM, Клочков Роман < [email protected] > wrote: >>When I describe type >> >>(_fun _string -> _string) >> >>where can I put, whether these string c-pointers should be freed after >>function call? Also, what is default behavior? >> >> >>-- >>Роман Клочков >>____________________ >> Racket Users list: >> http://lists.racket-lang.org/users >> > -- Roman Klochkov
____________________ Racket Users list: http://lists.racket-lang.org/users

