[m-rev.] diff: can_pass_as_mercury_type in io.m
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Nov 28 16:41:26 AEDT 2005
library/io.m:
Add "can_pass_as_mercury_type" annotations to some types defined in C.
These improve speed by about 1%.
Zoltan.
cvs server: Diffing library
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.340
diff -u -b -r1.340 io.m
--- library/io.m 20 Nov 2005 23:08:11 -0000 1.340
+++ library/io.m 28 Nov 2005 05:39:15 -0000
@@ -1600,7 +1600,8 @@
:- type io__binary_stream == io__stream.
:- type io__stream ---> io__stream(c_pointer).
-:- pragma foreign_type("C", io__stream, "MercuryFilePtr").
+:- pragma foreign_type("C", io__stream, "MercuryFilePtr",
+ [can_pass_as_mercury_type]).
:- pragma foreign_type("il", io__stream,
"class [mercury]mercury.io__csharp_code.MR_MercuryFileStruct").
:- pragma foreign_type("Java", io__stream, "mercury.io.MR_MercuryFileStruct").
@@ -3105,7 +3106,7 @@
% Buffer sizes are measured in Chars.
:- type buffer.
-:- pragma foreign_type(c, buffer, "MR_Char *").
+:- pragma foreign_type(c, buffer, "MR_Char *", [can_pass_as_mercury_type]).
% XXX It would be better to use a char_array (e.g. defined as char[] in
% C#) type rather than array(char). This is because on the Java and IL
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list