[project @ 2000-04-12 17:33:16 by simonmar]
This commit fixes the trace/stderr problem, and also fixes some other problems with the I/O library. - handles now contain a list of free buffers, which are guaranteed to be the same size as the primary handle buffer. - hPutStr now doesn't evaluate any part of the input string with the handle locked. Instead, it acquires a buffer from the handle copies characters into it, then commits the buffer. This is better for concurrency too, because the handle is only locked while we're actually reading/writing, not while evaluating. - there were an even number of off-by-one errors in the I/O system which compensated for each other. This has been fixed. - made the I/O subsystem a little more exception-safe. It still isn't totally exception-safe, but I can't face doing that without a complete rewrite of this thing in Haskell. - add hPutBufFull and hGetBufFull. The compiler probably needs to be updated to use these too.
Showing
- ghc/lib/std/PrelHandle.lhs 85 additions, 106 deletionsghc/lib/std/PrelHandle.lhs
- ghc/lib/std/PrelIO.lhs 218 additions, 161 deletionsghc/lib/std/PrelIO.lhs
- ghc/lib/std/PrelIOBase.lhs 4 additions, 3 deletionsghc/lib/std/PrelIOBase.lhs
- ghc/lib/std/cbits/Makefile 10 additions, 1 deletionghc/lib/std/cbits/Makefile
- ghc/lib/std/cbits/fileObject.c 2 additions, 1 deletionghc/lib/std/cbits/fileObject.c
- ghc/lib/std/cbits/fileObject.h 1 addition, 12 deletionsghc/lib/std/cbits/fileObject.h
- ghc/lib/std/cbits/flushFile.c 5 additions, 1 deletionghc/lib/std/cbits/flushFile.c
- ghc/lib/std/cbits/openFile.c 1 addition, 4 deletionsghc/lib/std/cbits/openFile.c
- ghc/lib/std/cbits/readFile.c 12 additions, 16 deletionsghc/lib/std/cbits/readFile.c
- ghc/lib/std/cbits/stgio.h 2 additions, 1 deletionghc/lib/std/cbits/stgio.h
- ghc/lib/std/cbits/writeFile.c 39 additions, 7 deletionsghc/lib/std/cbits/writeFile.c
Loading
Please register or sign in to comment