Skip to content

Commit 03b1883

Browse files
committed
For clarity, change _longobject to build directly from PyObject_VAR_HEAD
instead of faking it by hand. It *is* a var object, and nothing but hysterical raisins to pretend it's an oddball.
1 parent 5329cdb commit 03b1883

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Include/longintrepr.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */
3636
digit) is never zero. Also, in all cases, for all valid i,
3737
0 <= ob_digit[i] <= MASK.
3838
The allocation function takes care of allocating extra memory
39-
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. */
39+
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
40+
41+
CAUTION: Generic code manipulating subtypes of PyVarObject has to
42+
aware that longs abuse ob_size's sign bit.
43+
*/
4044

4145
struct _longobject {
42-
PyObject_HEAD
43-
int ob_size;
46+
PyObject_VAR_HEAD
4447
digit ob_digit[1];
4548
};
4649

0 commit comments

Comments
 (0)