caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alexander Fuchs <fuchs@cs.uiowa.edu>
To: caml-list@yquem.inria.fr
Subject: C Interface - Native-Code / Bytecode
Date: Thu, 23 Feb 2006 17:03:30 -0600	[thread overview]
Message-ID: <43FE3F42.9020802@cs.uiowa.edu> (raw)

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


                 reply	other threads:[~2006-02-23 23:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43FE3F42.9020802@cs.uiowa.edu \
    --to=fuchs@cs.uiowa.edu \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).