On Wednesday 01 October 2008, Martin Guy wrote:
> If you don't want to make the code portable and your are running a
> recent Linux, a fast fix is to
> echo 2 > /proc/cpu/alignment
> which should make the kernel trap misaligned accesses and fix them up
> for you, with a loss in performance of cou
I have a Pentium-4 HT 521 running in 64 bit mode here, which seems to have a
branch prediction or prefetch misfeature. Here is an example:
// stall.c
typedef int (*fn)(void*);
int nop(void* ip)
{
fn *next=((fn*)ip)+1;
#ifdef HEIMLICH
// choked?
if (ip==0) abort();
#e