patch applied (hat): A big re-organisation of I/O. Two main changes:
Wed Oct 18 05:43:27 PDT 2000 malcolm * A big re-organisation of I/O. Two main changes: (1) Foreign functions of IO type (going via the primitive FFI) are now handled via wrapper functions _mkIOokN (where N is the arity) rather than by the special bytecode MKIORETURN. (2) The internal runtime system representations of file handles and ForeignObjs have been made simpler. ForeignObjs are now the basic mechanism, with file handles as just one instance of a ForeignObj. Between them, these solve several bugs: * a shared IO computation was only executed once * an IO CAF (i.e. zero-arity) was only executed once whether shared or not * tracing of foreign IO was also suspect for the same reasons * hClose'd files were not being deallocated quickly enough, leading to some I/O-intensive programs hitting the file allocation limit unnecessarily * it was too difficult for users to get hold of a file handle as an ordinary value to use in foreign functions M ./src/compiler98/Case.hs -1 +1 M ./src/compiler98/DbgDataTrans.hs -22 +10 M ./src/compiler98/DbgTrans.hs -2 M ./src/compiler98/Extract.hs -2 +1 A ./src/compiler98/FFITrans.hs M ./src/compiler98/Foreign.hs -23 +27 M ./src/compiler98/Main.hs -14 +47 M ./src/compiler98/Makefile -1 +1 M ./src/compiler98/Need.hs +2 M ./src/compiler98/PPSyntax.hs -1 +1 M ./src/compiler98/Parse.hs -11 +9 M ./src/compiler98/ParseLex.hs -1 +2 M ./src/compiler98/PosCode.hs -1 +2 M ./src/compiler98/SccModule.hs -8 +10 M ./src/compiler98/StrPos.hs -1 +1 M ./src/compiler98/Syntax.hs -5 +8 M ./src/compiler98/TokenId.hs -2 +7 M ./src/compiler98/TokenInt.hs -3 +7 M ./src/compiler98/Type.hs -113 +209 M ./src/old/runtime/io.c -10 +9
participants (1)
-
Malcolm Wallace