Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] C ffi issue
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jeff Henrikson <jehenrik@y...>
Subject: [Caml-list] C ffi issue

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?

	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.


Jeff Henrikson

Bug reports:  FAQ:
To unsubscribe, mail  Archives: