File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ static inline void _PyObject_GC_SET_SHARED(PyObject *op) {
133
133
*/
134
134
#define _PyGC_NEXT_MASK_OLD_SPACE_1 1
135
135
136
- #define _PyGC_PREV_SHIFT _PyObject_ALIGNMENT_SHIFT
136
+ #define _PyGC_PREV_SHIFT 2
137
137
#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT)
138
138
139
139
/* set for debugging information */
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ struct atexit_state {
159
159
typedef struct {
160
160
// Tagged pointer to next object in the list.
161
161
// 0 means the object is not tracked
162
- _Py_ALIGNED_DEF (1 << _PyObject_ALIGNMENT_SHIFT , uintptr_t ) _gc_next ;
162
+ _Py_ALIGNED_DEF (_PyObject_MIN_ALIGNMENT , uintptr_t ) _gc_next ;
163
163
164
164
// Tagged pointer to previous object in the list.
165
165
// Lowest two bits are used for flags documented later.
Original file line number Diff line number Diff line change @@ -103,8 +103,9 @@ whose size is determined when the object is allocated.
103
103
104
104
/* PyObjects are given a minimum alignment so that the least significant bits
105
105
* of an object pointer become available for other purposes.
106
+ * This must be an integer literal with the value (1 << _PyGC_PREV_SHIFT)
106
107
*/
107
- #define _PyObject_ALIGNMENT_SHIFT 2
108
+ #define _PyObject_MIN_ALIGNMENT 4
108
109
109
110
/* Nothing is actually declared to be a PyObject, but every pointer to
110
111
* a Python object can be cast to a PyObject*. This is inheritance built
@@ -141,7 +142,7 @@ struct _object {
141
142
#else
142
143
Py_ssize_t ob_refcnt ;
143
144
#endif
144
- _Py_ALIGNED_DEF (1 << _PyObject_ALIGNMENT_SHIFT , char ) _aligner ;
145
+ _Py_ALIGNED_DEF (_PyObject_MIN_ALIGNMENT , char ) _aligner ;
145
146
};
146
147
#ifdef _MSC_VER
147
148
__pragma (warning (pop ))
@@ -159,7 +160,7 @@ struct _object {
159
160
// ob_tid stores the thread id (or zero). It is also used by the GC and the
160
161
// trashcan mechanism as a linked list pointer and by the GC to store the
161
162
// computed "gc_refs" refcount.
162
- _Py_ALIGNED_DEF (1 << _PyObject_ALIGNMENT_SHIFT , uintptr_t ) ob_tid ;
163
+ _Py_ALIGNED_DEF (_PyObject_MIN_ALIGNMENT , uintptr_t ) ob_tid ;
163
164
uint16_t ob_flags ;
164
165
PyMutex ob_mutex ; // per-object lock
165
166
uint8_t ob_gc_bits ; // gc-related state
You can’t perform that action at this time.
0 commit comments