Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-06-27 (12:53)
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 
-- Lewis Carroll

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: