about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-09-18 09:08:00 +0000
committerEric Wong <normalperson@yhbt.net>2010-09-18 09:08:00 +0000
commitdaec89e0cae4b4f87cd263d385eca353c04f3f0d (patch)
tree558a3a6c7e3c212cc166a5c523ca27fa5185329b /test
parentc658a2be7355ceee72736cc17754022dc7abfa9f (diff)
downloadraindrops-daec89e0cae4b4f87cd263d385eca353c04f3f0d.tar.gz
Modern glibc can easily return the L1 cache line size with
sysconf(3), so we'll use that and avoid paying a size penalty on
CPUs with smaller cache lines than 128 (every modern x86 except
the idiotic P4).

Additionally, if we detect a single CPU machine, avoid paying
any padding penalty at all.

On machines without the non-portable glibc sysconf(3)
enhancements, we'll continue to operate on the assumption
of an enormous 128 byte cache line size.
Diffstat (limited to 'test')
-rw-r--r--test/test_raindrops.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_raindrops.rb b/test/test_raindrops.rb
index 93885ef..aab1f14 100644
--- a/test/test_raindrops.rb
+++ b/test/test_raindrops.rb
@@ -4,6 +4,12 @@ require 'raindrops'
 
 class TestRaindrops < Test::Unit::TestCase
 
+  def test_raindrop_size
+    assert_kind_of Integer, Raindrops::SIZE
+    assert Raindrops::SIZE > 0
+    puts "Raindrops::SIZE = #{Raindrops::SIZE}"
+  end
+
   def test_size
     rd = Raindrops.new(4)
     assert_equal 4, rd.size