[Bf-blender-cvs] [9e2f678ba25] blender2.8: Fix mistake in atomic bitmap

Sergey Sharybin noreply at git.blender.org
Wed Aug 1 18:43:25 CEST 2018


Commit: 9e2f678ba25cb292257fc9949373917ec48a6d46
Author: Sergey Sharybin
Date:   Wed Aug 1 10:52:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9e2f678ba25cb292257fc9949373917ec48a6d46

Fix mistake in atomic bitmap

Internally values are stored as 32bit integers, no idea why i thought
they were 8 bit.

===================================================================

M	source/blender/blenlib/BLI_bitmap.h

===================================================================

diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index bf3329f8ed5..03390a0dbcd 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -72,9 +72,9 @@ typedef unsigned int BLI_bitmap;
 
 #define BLI_BITMAP_TEST_AND_SET_ATOMIC(_bitmap, _index) \
 	(CHECK_TYPE_ANY(_bitmap, BLI_bitmap *, const BLI_bitmap *), \
-	(atomic_fetch_and_or_uint8((uint8_t*)&(_bitmap)[(_index) >> _BITMAP_POWER], \
-	                          (1u << ((_index) & _BITMAP_MASK))) & \
-	                          (1u << ((_index) & _BITMAP_MASK))))
+	(atomic_fetch_and_or_uint32((uint32_t*)&(_bitmap)[(_index) >> _BITMAP_POWER], \
+	                            (1u << ((_index) & _BITMAP_MASK))) & \
+	                            (1u << ((_index) & _BITMAP_MASK))))
 
 #define BLI_BITMAP_TEST_BOOL(_bitmap, _index) \
 	(CHECK_TYPE_ANY(_bitmap, BLI_bitmap *, const BLI_bitmap *), \



More information about the Bf-blender-cvs mailing list