From b05c120f3d2ca617ac17f80d6359727de22681ec Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jan 2011 16:51:47 -0800 Subject: [PATCH] Bump up the default cache line size. --- include/SDL_cpuinfo.h | 8 +++++--- test/testatomic.c | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/SDL_cpuinfo.h b/include/SDL_cpuinfo.h index ea29df9da..f63140688 100644 --- a/include/SDL_cpuinfo.h +++ b/include/SDL_cpuinfo.h @@ -39,10 +39,12 @@ extern "C" { /* *INDENT-ON* */ #endif -/* This is a guess for the cacheline size used for padding, and is correct - * for most x86 processors at this point. +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. */ -#define SDL_CACHELINE_SIZE 64 +#define SDL_CACHELINE_SIZE 128 /** * This function returns the number of CPU cores available. diff --git a/test/testatomic.c b/test/testatomic.c index 0c9b13a27..89bf09fc0 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -3,6 +3,7 @@ #include "SDL.h" #include "SDL_atomic.h" #include "SDL_assert.h" +#include "SDL_cpuinfo.h" /* Absolutely basic tests just to see if we get the expected value