From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA07883; Wed, 19 Sep 2001 11:55:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA08023 for ; Wed, 19 Sep 2001 11:55:08 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8J9t7X28458 for ; Wed, 19 Sep 2001 11:55:07 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id LAA0000027232; Wed, 19 Sep 2001 11:55:07 +0200 (MET DST) Date: Wed, 19 Sep 2001 11:55:07 +0200 (MET DST) From: Damien Doligez Message-Id: <200109190955.LAA0000027232@beaune.inria.fr> To: caml-list@inria.fr, jehenrik@yahoo.com Subject: Re: [Caml-list] C ffi issue Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >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; Although it was not designed for this use, modify will work correctly in this context. I now guarantee that it won't crash if you use it in this way. It is a bit less efficient than direct assignment (it does a little pointer arithmetic plus a memory read and a conditional branch). -- Damien ------------------- 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