]> granicus.if.org Git - php/commitdiff
Merge HashTable.u.v.consistency into HashTable.u.v.flags
authorDmitry Stogov <dmitry@zend.com>
Mon, 22 Jan 2018 12:32:34 +0000 (15:32 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 22 Jan 2018 12:32:34 +0000 (15:32 +0300)
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_types.h

index 324f9fd4b3d3ce77f174b59e79765abd08753a83..f5670dd3709fa4c8a06b4713189c22df44a06de4 100644 (file)
 #if ZEND_DEBUG
 
 #define HT_OK                                  0x00
-#define HT_IS_DESTROYING               0x40
-#define HT_DESTROYED                   0x80
-#define HT_CLEANING                            0xc0
+#define HT_IS_DESTROYING               0x01
+#define HT_DESTROYED                   0x02
+#define HT_CLEANING                            0x03
 
 static void _zend_is_inconsistent(const HashTable *ht, const char *file, int line)
 {
-       if (ht->u.v.consistency == HT_OK) {
+       if ((HT_FLAGS(ht) & HASH_FLAG_CONSISTENCY) == HT_OK) {
                return;
        }
-       switch (ht->u.v.consistency) {
+       switch (HT_FLAGS(ht) & HASH_FLAG_CONSISTENCY) {
                case HT_IS_DESTROYING:
                        zend_output_debug_string(1, "%s(%d) : ht=%p is being destroyed", file, line, ht);
                        break;
@@ -65,7 +65,7 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
 }
 #define IS_CONSISTENT(a) _zend_is_inconsistent(a, __FILE__, __LINE__);
 #define SET_INCONSISTENT(n) do { \
-               (ht)->u.v.consistency = n; \
+               HT_FLAGS(ht) = (HT_FLAGS(ht) & ~HASH_FLAG_CONSISTENCY) | (n); \
        } while (0)
 #else
 #define IS_CONSISTENT(a)
index d48e47f0e213e3ab08a120bb3337a42b6478b42e..af9c21a7ecc208630facafc2e8a219dd7fe5261e 100644 (file)
@@ -35,6 +35,7 @@
 #define HASH_ADD_NEW                   (1<<3)
 #define HASH_ADD_NEXT                  (1<<4)
 
+#define HASH_FLAG_CONSISTENCY      ((1<<0) | (1<<1))
 #define HASH_FLAG_PACKED           (1<<2)
 #define HASH_FLAG_INITIALIZED      (1<<3)
 #define HASH_FLAG_STATIC_KEYS      (1<<4) /* long and interned strings */
index ef1b83a11c9f431d7fe92e2c61583239d5851d18..7fa90fdbd11f0091d1141b0663bad3b7aabb33a6 100644 (file)
@@ -243,7 +243,7 @@ struct _zend_array {
                                zend_uchar    flags,
                                zend_uchar    _unused,
                                zend_uchar    nIteratorsCount,
-                               zend_uchar    consistency)
+                               zend_uchar    _unused2)
                } v;
                uint32_t flags;
        } u;