From 44baf906e73c13577186e3135be4356b33b8be43 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 2 Jan 2019 20:37:38 +0000 Subject: use sleepy_penguin 3.5+ for splice and tee support Eliminate loading of the io_splice RubyGem to reduce memory overhead. Extra DSOs are wasteful and io_splice is being phased oiut for sleepy_penguin, which encapsulates more Linux-specific functionality anyways. cf. https://udrepper.livejournal.com/8790.html --- lib/dtas/buffer.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/dtas/buffer.rb') diff --git a/lib/dtas/buffer.rb b/lib/dtas/buffer.rb index 6f43dfa..c3d8ee2 100644 --- a/lib/dtas/buffer.rb +++ b/lib/dtas/buffer.rb @@ -8,7 +8,9 @@ require_relative '../dtas' class DTAS::Buffer # :nodoc: begin raise LoadError, "no splice with _DTAS_POSIX" if ENV["_DTAS_POSIX"] - require 'io/splice' # splice is only in Linux for now... + require 'sleepy_penguin' # splice is only in Linux for now... + SleepyPenguin.respond_to?(:splice) or + raise LoadError, 'sleepy_penguin 3.5+ required for splice', [] require_relative 'buffer/splice' include DTAS::Buffer::Splice rescue LoadError -- cgit v1.2.3-24-ge0c7