about summary refs log tree commit homepage
path: root/ext
DateCommit message (Collapse)
2020-02-22doc: update URLs to point to YHBT.net
bogomips.org is going away since .org isn't going to be affordable, anymore. While we're at it, stop requiring olddoc to just build the gem.
2015-01-10favor comparisons against zero instead of -1
This should allow faster instructions to be used in some cases. Technically this may be less pedantically correct, but there is enough existing code out there which does the same thing to discourage kernel/libc developers from overloading negative return values. ...And glibc even favors comparison against zero, too.
2015-01-10pack internal structs for 64-bit systems
This reduces stack usage in some places, perhaps providing a miniscule improvement in GC performance. struct before after difference splice_args 48 40 8 vmsplice_args 32 24 8
2015-01-10move mailing list to ruby-io-splice@bogomips.org
The public-inbox + mlmmj setup on bogomips.org allows posting without subscription and offers downloadable archives via git. The lack of rsyncable archives on librelist nowadays and subscription-required nature of librelist are points against it. Repliers are now encouraged to Cc: all recipients (using the reply-all function of their mail client) since many readers are not subscribed. This project has never accepted or encouraged HTML email, but librelist accepted it. The bogomips.org mail server is configured to treat HTML mail as spam, so do not send HTML mail if you expect a response. Users who wish to subscribe may send a message to: ruby-io-splice+subscribe@bogomips.org Similarly, they may unsubscribe via: ruby-io-splice+unsubscribe@bogomips.org HTTP archives are available via: http://bogomips.org/ruby-io-splice/ ssoma users may also use: git://bogomips.org/ruby-io-splice (see README change) Old messages to the librelist addresses will continue to get routed to the new mailing list. ref: http://public-inbox.org/
2014-02-15avoid deprecated rb_thread_blocking_region on 2.0+
rb_thread_blocking_region is not in ruby trunk as of r44955
2014-02-09deprecate and remove docs for IO::Splice::WAITALL
This functionality should not be implemented in Ruby, at least. This flag could also conflict with future flags used by the underlying syscalls.
2014-02-09prepare for rb_thread_blocking_region removal
It'll be OK to use rb_thread_call_without_gvl when rb_thread_blocking_region is not detectable at all. We still use rb_thread_blocking_region for Ruby 2.0-2.1 because rb_thread_call_without_gvl was detectable in 1.9.3, but not usable as an internal symbol. ref: https://bugs.ruby-lang.org/issues/9502
2013-09-26avoid RARRAY_PTR usage for vmsplice
In case somebody finds vmsplice useful in Ruby, we avoid incurring the performance loss from RARRAY_PTR under Ruby 2.1.0 and Rubinius. However, I still haven't found a useful use of vmsplice under Ruby (or any high-level languages).
2013-04-21set close-on-exec in pipe size modification check
This prevents a file descriptor leak in case another thread forks and execs while we are in the middle of loading. This places a hard dependency on pipe2, but pipe2 appeared in Linux before pipe size modification.
2013-01-19vmsplice: more consistent fileno retry handling
While vmsplice is hardly useful, its FD-closed-while-GVL-less handling should be as good as our splice and tee wrappers.
2013-01-19vmsplice: avoid referencing invalid stack address for strings
Newer GCC more aggressively optimizes stack allocations away, so we need to avoid passing out-of-scope addresses to vmsplice. Not that vmsplice is useful in Ruby...
2012-03-08doc: s/librelist.com/librelist.org/
.org makes us look less commercial, which may be important to some folks. Yes, this project is run by a dirty hippie.
2012-03-07avoid uname() for pipe size modification checks
The uname comparison is fragile and we can better detect this during the Init_* function by just using a pipe.
2011-05-18limit maximum splice length to 1 << 30
This is the same value haproxy has to work around the same issue on 64-bit platforms. ref: a9de333aa58e6cb76f08a50e8ba2c5931184068f in http://git.1wt.eu/git/haproxy.git
2011-05-17expand doc for non-blocking splice into a pipe
We should warn our users to avoid a blocking splice() from a socket into a pipe if the socket buffers are full unless there's a blocking read/splice on the other end of the pipe.
2011-05-12fix up documentation for fd vs IO objects
We support both, but IO objects are easier to use so refer to those in the documentation.
2011-05-09add IO::Splice::WAITALL flag support
This allows splice-in-full and tee-in-full behavior to simplify user code.
2011-05-09use ssize_t/size_t instead of long/unsigned long
Easier to read this way since it matches upstream functions.
2011-05-09detect closed descriptors on EINTR
We don't want to retry with the same FD if it somehow got closed and reopened in a different thread. We could possibly have Errno::EBADF, too, but rb_thread_io_blocking_region doesn't allow multiple file descriptors...
2011-05-09my_fileno: use FIX2INT instead of NUM2INT
No chance in hell a file descriptor can be a Bignum...
2011-05-09retry on EINTR
This makes things consistent with Ruby core IO methods
2011-04-27extconf: remove unnecessary dir_config statement
I didn't know mkmf at the time :<
2011-02-28doc: more notes for IO.vmsplice
HALP!
2011-02-28doc: RDoc for new interfaces and changes
And yes, encourage them for non-blocking I/O users.
2011-02-28IO.vmsplice flags argument defaults to zero
For consistency with all of our other methods.
2011-02-28add IO.trytee interface
This allows more-efficient use of non-blocking I/O with tee(2) and will return :EAGAIN instead of generating an expensive Errno::EAGAIN exception.
2011-02-26trysplice implies SPLICE_F_NONBLOCK for flags
It makes more sense this way if non-blocking I/O is expected.
2011-02-26flags are optional for splice and trysplice
No point in requiring the flags argument if it's going to be zero, so default them to zero if they're unset.
2011-02-26shorten calls to rb_thread_blocking_region
Long lines bother me
2011-02-26avoid signed vs unsigned comparison
Caught when compiling with the CFLAGS of Ruby 1.9.3dev
2011-02-26add IO.trysplice interface
This reduces the cost of EAGAIN and EOF since they are not considered exceptional conditions.
2010-08-02add IO#pipe_size and IO#pipe_size= accessors
These are friendly wrappers around F_GETPIPE_SZ and F_SETPIPE_SZ fcntl()s in Linux 2.6.35.
2010-06-05Ruby io_splice 2.0.0 v2.0.0
There is a new IO::Splice.copy_stream method which is similar to the IO.copy_stream method in 1.9 core, but uses splice() internally to avoid copies to userspace in situations where sendfile() is not possible. With Linux 2.6.35 (and header files to match), we will also export the F_GETPIPE_SZ and and F_SETPIPE_SZ constants so they can be used with fcntl() to resize pipe buffers. The documentation is also updated to reflect the returned usefulness of the IO::Splice::F_MOVE constant for FUSE filesystems under Linux 2.6.35. I've also relicensed to LGPLv2.1+ (from LGPLv3-only) to allow bundling with GPLv2-only applications (I'm currently the sole copyright holder). Signed-off-by: Eric Wong <normalperson@yhbt.net>
2010-06-05io_splice_ext: require errno.h
It seems needed for Rubinius
2010-06-03allow IO.vmsplice to take a single string
This could be useful if a Ruby implementation eventually gives us page-aligned strings that we can IO::Splice::F_GIFT
2010-06-01preliminary support for F_GETPIPE_SZ and F_SETPIPE_SZ
One day soon (2.6.35), we'll be able to resize pipes. We may support this independently of the C library since that can take a few months/years to catch up, taking distro release cycles into account, too.
2010-06-01update IO::Splice::F_MOVE documentation for 2.6.35
FUSE devices will finally gain splice() support and also support SPLICE_F_MOVE in 2.6.35. SPLICE_F_MOVE is still ignored for non-FUSE devices.
2010-05-27fix indentation bug
2010-05-27allow IO(-ish) objects as descriptor arguments
This should be more convenient to use than having to remember to call "fileno" every time...
2010-05-27IO.splice always releases the GVL
We can't reliably/efficiently know if the non-pipe descriptor may block, and releasing the GVL is fairly cheap under Linux.
2010-05-27doc: better explain the need for IO::Splice::F_NONBLOCK
2010-05-27avoid partial writes on IO.vmsplice unless F_NONBLOCK
vmsplice-ing a partial array of strings into a pipe is not very useful under Ruby, so wait for I/O availability if the pipe is full. This code/logic was also contributed to the io-extra gem (by me) for the IO.writev implementation. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2010-05-24split out ARY2IOVEC macro
2010-05-22"Splice" should be a module, not a class
We never create IO::Splice objects :x
2010-02-14initial