Bump up the default cache line size.
authorSam Lantinga <slouken@libsdl.org>
Thu, 27 Jan 2011 16:51:47 -0800
changeset 511602b860cbc7ce
parent 5115 427998ff3bcf
child 5117 16a326715f39
Bump up the default cache line size.
include/SDL_cpuinfo.h
test/testatomic.c
     1.1 --- a/include/SDL_cpuinfo.h	Thu Jan 27 16:46:15 2011 -0800
     1.2 +++ b/include/SDL_cpuinfo.h	Thu Jan 27 16:51:47 2011 -0800
     1.3 @@ -39,10 +39,12 @@
     1.4  /* *INDENT-ON* */
     1.5  #endif
     1.6  
     1.7 -/* This is a guess for the cacheline size used for padding, and is correct
     1.8 - * for most x86 processors at this point.
     1.9 +/* This is a guess for the cacheline size used for padding.
    1.10 + * Most x86 processors have a 64 byte cache line.
    1.11 + * The 64-bit PowerPC processors have a 128 byte cache line.
    1.12 + * We'll use the larger value to be generally safe.
    1.13   */
    1.14 -#define SDL_CACHELINE_SIZE  64
    1.15 +#define SDL_CACHELINE_SIZE  128
    1.16  
    1.17  /**
    1.18   *  This function returns the number of CPU cores available.
     2.1 --- a/test/testatomic.c	Thu Jan 27 16:46:15 2011 -0800
     2.2 +++ b/test/testatomic.c	Thu Jan 27 16:51:47 2011 -0800
     2.3 @@ -3,6 +3,7 @@
     2.4  #include "SDL.h"
     2.5  #include "SDL_atomic.h"
     2.6  #include "SDL_assert.h"
     2.7 +#include "SDL_cpuinfo.h"
     2.8  
     2.9  /*
    2.10    Absolutely basic tests just to see if we get the expected value