about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-30 02:05:22 +0000
committerEric Wong <normalperson@yhbt.net>2013-04-30 02:05:22 +0000
commitc1fdf07413364407d148fb588cd1c2ba1fe7f677 (patch)
treecf1d1e2456e4d9b1ed997c96b686f7308146a6af
parentd5e6ab56efd5a3c538c8f31b120c0dff6dbcf38a (diff)
downloadsleepy_penguin-c1fdf07413364407d148fb588cd1c2ba1fe7f677.tar.gz
This allows the heap to reclaim memory sooner (than waiting for
GC), lowering memory usage and perhaps speeding up future
allocations.
-rw-r--r--lib/sleepy_penguin/epoll.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sleepy_penguin/epoll.rb b/lib/sleepy_penguin/epoll.rb
index f29189a..637db8d 100644
--- a/lib/sleepy_penguin/epoll.rb
+++ b/lib/sleepy_penguin/epoll.rb
@@ -67,7 +67,7 @@ class SleepyPenguin::Epoll
     @io.epoll_wait(maxevents, timeout) { |events, io| yield(events, io) }
   ensure
     # hopefully Ruby does not optimize this array away...
-    snapshot[0]
+    snapshot.clear
   end
 
   # Starts watching a given +io+ object with +events+ which may be an Integer