projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tweak the BufferedIO class to enable a memory-mapped file implementation
[ghc-base.git]
/
GHC
/
IO
/
Handle
/
Text.hs
diff --git
a/GHC/IO/Handle/Text.hs
b/GHC/IO/Handle/Text.hs
index
754be02
..
168a5a5
100644
(file)
--- a/
GHC/IO/Handle/Text.hs
+++ b/
GHC/IO/Handle/Text.hs
@@
-748,9
+748,9
@@
bufWrite h_@Handle__{..} ptr count can_block =
-- else, we have to flush
else do debugIO "hPutBuf: flushing first"
-- else, we have to flush
else do debugIO "hPutBuf: flushing first"
- Buffered.flushWriteBuffer haDevice old_buf
+ old_buf' <- Buffered.flushWriteBuffer haDevice old_buf
-- TODO: we should do a non-blocking flush here
-- TODO: we should do a non-blocking flush here
- writeIORef haByteBuffer old_buf{bufL=0,bufR=0}
+ writeIORef haByteBuffer old_buf'
-- if we can fit in the buffer, then just loop
if count < size
then bufWrite h_ ptr count can_block
-- if we can fit in the buffer, then just loop
if count < size
then bufWrite h_ ptr count can_block