caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jeff Henrikson" <jehenrik@yahoo.com>
To: <caml-list@inria.fr>
Subject: [Caml-list] C ffi issue
Date: Wed, 19 Sep 2001 02:57:24 -0400	[thread overview]
Message-ID: <002201c140d8$561ded40$0b01a8c0@mit.edu> (raw)


According to the C interface documentation, assignments to tuple members must be done with the modify(value*,value) function.
However, local variables once registered with the GC can apparently just be assigned.  If I do this instead will anything crash?

	CAMLlocal1(nontuple);
	modify(&nontuple,mydata);  // should just be nontuple=mydata;

If this is bad, is there a performance efficient way to wrap modify so that I can assign to tuple members and local variables in
the same way?  I am writing a stub generator (language module for SWIG) and due to the way that the preexisting model works, it is
desirable to have this congruency.

The alternative of course is to allocate some tuples when I don't need to so that the modify function always gets what it expects,
and then throw them away when necessary.  This may be faster anyway, but if modify works out of the box I'll definitely take that.

Thanks,


Jeff Henrikson





-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


             reply	other threads:[~2001-09-19  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-19  6:57 Jeff Henrikson [this message]
2001-09-19  9:55 Damien Doligez

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='002201c140d8$561ded40$0b01a8c0@mit.edu' \
    --to=jehenrik@yahoo.com \
    --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;
as well as URLs for NNTP newsgroup(s).