[babl] palette: make the conversion hash table volatile



commit 4d260b74be347b87399c9d8d45889d82207e228f
Author: Ell <ell_se yahoo com>
Date:   Fri Jun 23 07:30:40 2017 -0400

    palette: make the conversion hash table volatile
    
    ... to avoid the theoretical possiblity of hash table entires being
    read more than once during conversion, defying atomicity.  Very,
    *very* paranoid, but what the hell :P

 babl/babl-palette.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/babl/babl-palette.c b/babl/babl-palette.c
index 3c32601..ad90608 100644
--- a/babl/babl-palette.c
+++ b/babl/babl-palette.c
@@ -55,12 +55,14 @@ static double defpal_double[4*8*16];
 
 typedef struct BablPalette
 {
-  int         count; /* number of palette entries */
-  const Babl *format;/* the pixel format the palette is stored in */
-  unsigned char *data;  /* one linear segment of all the pixels representing the palette, in   order */
-  double        *data_double;
-  unsigned char *data_u8;
-  unsigned int   hash[HASH_TABLE_SIZE];
+  int                    count;  /* number of palette entries */
+  const Babl            *format; /* the pixel format the palette is stored in */
+  unsigned char         *data;   /* one linear segment of all the pixels
+                                  * representing the palette, in order
+                                  */
+  double                *data_double;
+  unsigned char         *data_u8;
+  volatile unsigned int  hash[HASH_TABLE_SIZE];
 } BablPalette;
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]