Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: Nicolas Joliot <Nicolas.Joliot@irisa.fr>
Cc: caml-list@inria.fr
Subject: Re: Interfaçage C/CAML
Date: Thu, 10 Aug 2000 19:14:04 +0200	[thread overview]
Message-ID: <20000810191404.A21178@miss.wu-wien.ac.at> (raw)
In-Reply-To: <3992D2D9.906E0BA7@irisa.fr>; from Nicolas.Joliot@irisa.fr on Thu, Aug 10, 2000 at 18:05:45 +0200

[Francais] (Excusez-moi mon francais faible)

On Thu, 10 Aug 2000, Nicolas Joliot wrote:
> Lorsqu'elles sont appelées séparément, je peux afficher les resulats
> sans problème, mais lorsque les deux sont appelées successivement et que
> j'essaye d'afficher le tableau de floatants, j'ai systématiquement un
> "Bus Error".

Je ne suis pas sur, mais ca peut-etre un problem entre l'interface de C et
le GC...

> - déclaration : CAMLlocal1(tableau_float)
> - allocation : tableau_float=alloc(nb_element*2,Double_array_tag)
> - Utilisation :Store_double_field(tableau_float,i,floatant_a_renvoyer)
> _ retour sous CAML par CAMLreturn

Si je le comprends bien, le problem c'est l'utilisation du
"Store_double_field". La solution dans ce cas serait d'essayer le macro
"Double_field" en place de l'autre macro.

C'est souvant un source des erreurs - peut-etre on pourrait changer le nom
de "Store_double_field"? Il me semble que la plupart des programmeurs
soient confuses par "Store"...

"Store_..." ne doit etre utilise que avec des "blocs structures", ou il
sont obligatoirs.

Amicalement,
Markus Mottl

---------------------------------------------------------------------------

[English]

It seems that a common bug has struck again: using "Store_{whatever}" in
C-interfaces is only allowed (and then mandatory) with structured blocks.
Using it for anything else may crash the GC.

Maybe we could change the names of the "Store_..."-macros so that people
don't mistakenly believe that these are generally the right ones to "store"
values?  Something like "Store_Block_..." or similar (less verbose)?

Best regards,
Markus Mottl

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl



  reply	other threads:[~2000-08-11  8:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-10 16:05 Nicolas Joliot
2000-08-10 17:14 ` Markus Mottl [this message]
2000-08-11  8:24   ` Xavier Leroy
2000-08-11 10:54     ` Markus Mottl
2000-08-11  8:58   ` David Mentré
2000-08-14 17:35 David McClain

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=20000810191404.A21178@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=Nicolas.Joliot@irisa.fr \
    --cc=caml-list@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