File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1074,20 +1074,25 @@ def delx(self): del self.__x
10741074 fmt += '3n2P'
10751075 s = vsize (fmt )
10761076 check (int , s )
1077+ # class
10771078 s = vsize (fmt + # PyTypeObject
10781079 '3P' # PyAsyncMethods
10791080 '36P' # PyNumberMethods
10801081 '3P' # PyMappingMethods
10811082 '10P' # PySequenceMethods
10821083 '2P' # PyBufferProcs
10831084 '4P' )
1084- # Separate block for PyDictKeysObject with 8 keys and 5 entries
1085- s += calcsize ("2nP2n" ) + 8 + 5 * calcsize ("n2P" )
1086- # class
10871085 class newstyleclass (object ): pass
1088- check (newstyleclass , s )
1086+ # Separate block for PyDictKeysObject with 8 keys and 5 entries
1087+ check (newstyleclass , s + calcsize ("2nP2n0P" ) + 8 + 5 * calcsize ("n2P" ))
1088+ # dict with shared keys
1089+ check (newstyleclass ().__dict__ , size ('nQ2P' ) + 5 * self .P )
1090+ o = newstyleclass ()
1091+ o .a = o .b = o .c = o .d = o .e = o .f = o .g = o .h = 1
1092+ # Separate block for PyDictKeysObject with 16 keys and 10 entries
1093+ check (newstyleclass , s + calcsize ("2nP2n0P" ) + 16 + 10 * calcsize ("n2P" ))
10891094 # dict with shared keys
1090- check (newstyleclass ().__dict__ , size ('nQ2P' + '2nP2n' ) )
1095+ check (newstyleclass ().__dict__ , size ('nQ2P' ) + 10 * self . P )
10911096 # unicode
10921097 # each tuple contains a string and its expected character size
10931098 # don't put any static strings here, as they may contain
You can’t perform that action at this time.
0 commit comments