Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] interfacing C and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: art yerkes <ayerkes@o...>
Subject: Re: Re[2]: [Caml-list] interfacing C and OCaml
> Sorry, I've made a mistake myself. I've been talking mostly about "void" vs "value"
> issue in your examples, but this is already addressed in the manual by stating that
> the primitive function must return value. The documentation lacks introduction into
> the macroses "CAMLprim", "CAMLextern" etc, but they are not strictly required now
> if you are not dealing with Windows DLLs.

In my experience, it's completely safe to use the macros no matter where the
code is called from.  You can omit them only when that would be safe, (i.e.
you don't allocate anything into the caml heap).  You can get away with not
being nice to the GC only when you don't do anything that can trigger the
collector.  This means that if you do any alloc, alloc_tuple, copy_string, 
etc., then you must use them.  It's not only for windows DLLs.
-- 
`No, you don't understand,' the Knight said, looking a little vexed. 
`That's what the name is called. The name really is "The Aged Aged 
Man."'
-- Lewis Carroll

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners