caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* C Interface - Native-Code / Bytecode
@ 2006-02-23 23:03 Alexander Fuchs
  0 siblings, 0 replies; only message in thread
From: Alexander Fuchs @ 2006-02-23 23:03 UTC (permalink / raw)
  To: caml-list

Hi,

I have a problem with an OCaml program that links to a C-library via a 
C++ wrapper. In essence, the behavior of the C part is different when 
using native-code or bytecode compilation. It seems like the content of 
some variables diverges at some point. There are no calls from C to 
OCaml, yet.

Now, this might be a problem with the ownership of the memory between 
C/C++ and OCaml. But as far as I can tell from the manual, all the 
CAMLparam, CAMLlocal, and CAMLreturn calls are in place in the C++ 
wrapper, plus all C++ functions used by C and OCaml are declared as 
extern "C".

I get this behavior with ocaml 3.09.0 (Debian) and 3.09.1 (Redhat), with 
static and dynamic linking. I use OCamlMakefile to manage the compilation.

Does perhaps someone have an idea what might cause this different 
behavior in native and bytecode? Is there anything special to watch when 
using a C++ file?


Thanks,
	Alex


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-23 23:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 23:03 C Interface - Native-Code / Bytecode Alexander Fuchs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).