mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-03-12 16:55:47 +03:00
Avoid race on reading alignment in for-loop
This commit is contained in:
parent
10104eb5aa
commit
308e1fc93d
|
@ -201,7 +201,7 @@ extern struct ImagingMemoryArena ImagingArenas[IMAGING_ARENAS_COUNT + 1];
|
|||
* statically-allocated. This is necessary to properly handle stats.
|
||||
*/
|
||||
#define IMAGING_ARENAS_FOREACH(arena) \
|
||||
for ((arena) = &ImagingArenas[0]; (arena)->alignment >= 0; ++(arena))
|
||||
for ((arena) = &ImagingArenas[0]; (arena)->index >= 0; ++(arena))
|
||||
#else
|
||||
/* In this case we either have the GIL or do not have thread-local storage, in
|
||||
* which case we will only allocate a single arena.
|
||||
|
|
|
@ -282,7 +282,7 @@ struct ImagingMemoryArena ImagingArenas[IMAGING_ARENAS_COUNT + 1] = {
|
|||
{1, IMAGING_ARENA_BLOCK_SIZE, 0, 0, NULL, 0, 0, 0, 0, 0, 5, {0}},
|
||||
{1, IMAGING_ARENA_BLOCK_SIZE, 0, 0, NULL, 0, 0, 0, 0, 0, 6, {0}},
|
||||
{1, IMAGING_ARENA_BLOCK_SIZE, 0, 0, NULL, 0, 0, 0, 0, 0, 7, {0}},
|
||||
{-1},
|
||||
{1, IMAGING_ARENA_BLOCK_SIZE, 0, 0, NULL, 0, 0, 0, 0, 0, -1, {0}},
|
||||
};
|
||||
|
||||
/* Get a pointer to the correct arena for this context. In this case where we
|
||||
|
|
Loading…
Reference in New Issue
Block a user