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 IAA03727; Wed, 19 Sep 2001 08:45:20 +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 IAA03761 for ; Wed, 19 Sep 2001 08:45:19 +0200 (MET DST) Received: from ligarius-fe0.ultra.net (ligarius-fe0.ultra.net [146.115.8.189]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8J6jIX07498 for ; Wed, 19 Sep 2001 08:45:18 +0200 (MET DST) Received: from vaiobambino (d148.dial-6.cmb.ma.ultra.net [209.6.69.148]) by ligarius-fe0.ultra.net (8.8.8/ult/n26500/mtc.v2) with SMTP id CAA07497 for ; Wed, 19 Sep 2001 02:45:17 -0400 (EDT) From: "Jeff Henrikson" To: Subject: [Caml-list] C ffi issue Date: Wed, 19 Sep 2001 02:57:24 -0400 Message-ID: <002201c140d8$561ded40$0b01a8c0@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 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; 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