File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -132,21 +132,25 @@ typedef struct {
132132             * all characters are in the range U+0000-U+10FFFF 
133133             * at least one character is in the range U+10000-U+10FFFF 
134134         */ 
135-         unsigned int   kind :3 ;
135+         unsigned char   kind :3 ;
136136        /* Compact is with respect to the allocation scheme. Compact unicode 
137137           objects only require one memory block while non-compact objects use 
138138           one block for the PyUnicodeObject struct and another for its data 
139139           buffer. */ 
140-         unsigned int   compact :1 ;
140+         unsigned char   compact :1 ;
141141        /* The string only contains characters in the range U+0000-U+007F (ASCII) 
142142           and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is 
143143           set, use the PyASCIIObject structure. */ 
144-         unsigned int   ascii :1 ;
144+         unsigned char   ascii :1 ;
145145        /* The object is statically allocated. */ 
146-         unsigned int   statically_allocated :1 ;
146+         unsigned char   statically_allocated :1 ;
147147        /* Padding to ensure that PyUnicode_DATA() is always aligned to 
148-            4 bytes (see issue #19537 on m68k). */ 
149-         unsigned int  18 ;
148+            4 bytes (see issue #19537 on m68k) and we use unsigned char to avoid 
149+            the extra four bytes on 32-bit Windows. This is restricted features 
150+            for specific compilers including GCC, MSVC, Clang and IBM's XL compiler. */ 
151+         unsigned char  2 ;
152+         unsigned char  8 ;
153+         unsigned char  8 ;
150154    } state ;
151155} PyASCIIObject ;
152156
Original file line number Diff line number Diff line change @@ -2450,8 +2450,6 @@ def test_expandtabs_optimization(self):
24502450
24512451    def  test_raiseMemError (self ):
24522452        asciifields  =  "nnb" 
2453-         if  not  support .is_wasi :
2454-             asciifields  =  asciifields  +  "7x" 
24552453        compactfields  =  asciifields  +  "nP" 
24562454        ascii_struct_size  =  support .calcobjsize (asciifields )
24572455        compact_struct_size  =  support .calcobjsize (compactfields )
Original file line number Diff line number Diff line change @@ -1763,8 +1763,6 @@ class newstyleclass(object): pass
17631763                   '\U00010000 ' * 30 , '\U0010ffff ' * 100 ]
17641764        # also update field definitions in test_unicode.test_raiseMemError 
17651765        asciifields  =  "nnb" 
1766-         if  not  support .is_wasi :
1767-             asciifields  =  asciifields  +  "7x" 
17681766        compactfields  =  asciifields  +  "nP" 
17691767        unicodefields  =  compactfields  +  "P" 
17701768        for  s  in  samples :
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments