From: Jon Harrop <jdh30@hermes.cam.ac.uk>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] caml_oldify_local_roots crashes
Date: Sun, 26 Dec 2004 04:35:53 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.60.0412260428100.23835@hermes-1.csi.cam.ac.uk> (raw)
In-Reply-To: <I9A4MV$2E43D0D72D79CE0EEAF42771D086A320@laposte.net>
On Sat, 25 Dec 2004, haiku.issa wrote:
> I am currently developping a small piece of software that uses
> both OCaml and C (for openGL). The main loop is in C and I use
> callback to call a Caml function that processes the key that
> was pressed and returns the new state of a matrix.
Do you have to use C at all? Have you looked at lablGL?
I strongly recommend that you avoid interfacing to C whenever possible...
> Everything worked fine until I added a subfunction that simply
> merges two int lists.
I am no expert on this but I believe this implies that your interfacing
between C and OCaml was already broken. Almost certainly something to do
with the GC. There are rules that you must adhere to when writing the
interface code, of course, and human errors are a great cause of bugs
here. I'd also strongly recommend that you try to write the simplest
possible first working version and optimise it later only if necessary.
Unfortunately I'm too drunk and full of turkey to help with any code right
now...
Cheers,
Jon.
PS: If you program starts at "main" in C code then I assume you've
initialised the OCaml GC before calling any OCaml code?
next prev parent reply other threads:[~2004-12-26 4:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-25 13:11 haiku.issa
2004-12-26 4:35 ` Jon Harrop [this message]
2004-12-30 22:41 ` [Caml-list] " Richard Jones
2005-01-02 19:00 Zakath
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=Pine.LNX.4.60.0412260428100.23835@hermes-1.csi.cam.ac.uk \
--to=jdh30@hermes.cam.ac.uk \
--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