use runtime cache line size detection
commitdaec89e0cae4b4f87cd263d385eca353c04f3f0d
authorEric Wong <normalperson@yhbt.net>
Sat, 18 Sep 2010 09:08:00 +0000 (18 09:08 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 18 Sep 2010 09:08:00 +0000 (18 09:08 +0000)
tree558a3a6c7e3c212cc166a5c523ca27fa5185329b
parentc658a2be7355ceee72736cc17754022dc7abfa9f
use runtime cache line size detection

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.
ext/raindrops/raindrops.c
test/test_raindrops.rb