[m-dev.] diff: add `pragma inline' declarations for io__read_{byte,char}
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Dec 14 00:46:46 AEDT 1999
Estimated hours taken: 0.5
Fix a performance problem reported by Ralph Becket.
library/io.m:
Add `pragma inline' declarations for io__read_char and io__read_byte,
to enable deforestation to optimize calls to them.
Workspace: /d-drive/home/hg/fjh/ws-hg2/mercury
Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.190
diff -u -d -r1.190 io.m
--- library/io.m 1999/11/25 09:09:38 1.190
+++ library/io.m 1999/12/13 13:41:37
@@ -1151,6 +1151,10 @@
% input predicates
+% we want to inline these, to allow deforestation
+:- pragma inline(io__read_char/3).
+:- pragma inline(io__read_char/4).
+
io__read_char(Result) -->
io__input_stream(Stream),
io__read_char(Stream, Result).
@@ -1169,6 +1173,10 @@
io__make_err_msg("read failed: ", Msg),
{ Result = error(io_error(Msg)) }
).
+
+% we want to inline these, to allow deforestation
+:- pragma inline(io__read_byte/3).
+:- pragma inline(io__read_byte/4).
io__read_byte(Result) -->
io__binary_input_stream(Stream),
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list