| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I/O library rewrite
-------------------
This commit replaces the old C/Haskell I/O implementation with a new
Haskell-only one using the new FFI & hsc2hs.
main points:
- lots of code deleted: we're about 3000 lines of C lighter,
but the amount of Haskell code is about the same.
- performance is ok: some operations are faster, others are
slower. There's still some tuning to do, though.
- the new library is designed to handle read/write streams
much better: a read/write stream gets a special kind of
handle internally called a "DuplexHandle", which actually
contains two separate handles, one for writing and one for
reading. The upshot is that you can do simultaneous reading
and writing to/from a socket or FIFO without any locking
problems. The effect is similar to calling socketToHandle
twice, except that finalization works properly (creating
two separate Handles could lead to the socket being closed
too early when one of the Handles is GC'd).
- hConnectTo and withHandleFor are gone (no one responded to
my mail on GHC users, but we can always bring 'em back if
necessary).
- I made a half-hearted attempt at keeping the system-specific
code in one place: see PrelPosix.hsc.
- I've rearranged the I/O tests and added lots more.
ghc/tests/lib/IO now contains Haskell 98-only IO tests,
ghc/test/lib/{IOExts, Directory, Time} now contain tests for
the relevant libraries. I haven't quite finished in here yet,
the IO tests work but the others don't yet.
- I haven't done anything about Unicode yet, but now we can
start to discuss what needs doing here. The new library
is using MutableByteArrays for its buffers because that
turned out to be a *lot* easier (and quicker) than malloc'd
buffers - I hope this won't cause trouble for unicode
translations though.
WARNING: Windows users refrain from updating until we've had a chance
to fix any issues that arise.
Testing: the basic H98 stuff has been pretty thoroughly tested, but
the new duplex handle stuff is still a little green.
|
|
|
|
| |
Spell "flush" "flush" not "flish".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleaning up the foreign object naming mess:
* Renamed the primop from makeForeignObj# to mkForeignObj#, this
is more consistent with the old Foreign.mkForeignObj.
* PrelForeign now exports makeForeignObj with the new signature.
* freeFile.c now uses StgAddr instead of StgForeignObj, this
removes the need for some fixIOs.
* Lots of import tweaking to prepare The Big Foreign Renamer,
which will move most of Foreign to ForeignObj, and FFI to Foreign.
Note: I've tried to track the changes in the interpreter sources, but
didn't test them.
|
|
|
|
|
| |
We weren't releasing the memory associated with dead file objects
(including the possibly large buffer). This commit fixes that.
|
|
|
|
| |
Rename error.h to stgerror.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Incremental cleanups & improvements to the I/O subsystem
- Initial fix for problems caused by partial writes
to non-blocking file descriptors. To see this bug,
run ghc/tests/programs/life_space_leak through a pipe.
- remove FILEOBJ_FLUSH, it allegedly has the same meaning
as FILEOBJ_WRITE. This fixes a buf in openFd: it erroneously didn't
set FILEOBJ_FLUSH on writeable file descriptors.
- some ANSIfication
|
|
|
|
| |
Cygwin B19 compatibility fixes
|
|
|
|
| |
Don't compile in WinSock support under cygwin
|
|
|
|
| |
Winsock support
|
|
|
|
| |
Move 4.01 onto the main trunk.
|
|
|
|
| |
clean up the mess.
|
|
New Run-Time System Support, includes:
- New code generator
- Modifications to the mangler
- Unboxed Tuple support
- Various other minor changes.
|