java.io fix and speedup
Mark Wielaard
mark@klomp.org
Thu Jan 2 23:14:00 GMT 2003
Hi,
The following fixes a small issue in FileInputStream. When
FileInputStream was finalized it would also force the finalization of
the underlying FileDescriptor. But the FileDescriptor could have been
shared with other FileInputStreams or RandomAccessFiles. The patch makes
the behaviour the same as for FileOutputStream.finalize(), which means a
noop. It also makes FileDescriptor a little bit more efficient by making
less system calls. (I only changed the Posix version.) This gives me a
small (~1%) speedup in IO intensive programs.
2003-01-02 Mark Wielaard <mark@klomp.org>
* java/io/FileInputStream.java (finalize): Don't explicitly
finalize FileDescriptor.
* java/io/FileDescriptor.java (position): New private field.
* java/io/natFileDescriptorPosix.cc (write): Up position.
(setLength): Use and set position.
(seek): Set position.
(getFilePointer): Return position.
(read): Up position.
OK for branch and mainline?
Cheers,
Mark
More information about the Java-patches
mailing list