Version française
Home     About     Download     Resources     Contact us    
Browse thread
Wrapping OCaml function returning a variant
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Joel Reymont <joelr1@g...>
Subject: Re: [Caml-list] Wrapping OCaml function returning a variant

On Mar 28, 2007, at 1:55 PM, Serge Aleynikov wrote:

> If you are using caml_copy_string() or caml_alloc_string() they  
> allocate strings on OCaml's heap, and will be automatically garbage  
> collected.

How do I pass a C string into OCaml if the assumption is that it will  
not be modified? Do I still need to copy it with caml_copy_string?

I don't think I need to allocate strings on the OCaml heap from C as  
the string given to OCaml will be allocated on the C heap and the  
string returned from OCaml will be garbage-collected automatically.

	Thanks, Joel

--
http://wagerlabs.com/