8000 gh-128137: Update PyASCIIObject to handle interned field with the atomic operation by corona10 · Pull Request #128196 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128137: Update PyASCIIObject to handle interned field with the atomic operation #128196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jan 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address code review
  • Loading branch information
corona10 committed Jan 2, 2025
commit 7d4955c2d5c953055f84b5613aae153c218e0596
12 changes: 7 additions & 5 deletions Include/cpython/unicodeobject.h
4B6A
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,25 @@ typedef struct {
* all characters are in the range U+0000-U+10FFFF
* at least one character is in the range U+10000-U+10FFFF
*/
unsigned short kind:3;
unsigned char kind:3;
/* Compact is with respect to the allocation scheme. Compact unicode
objects only require one memory block while non-compact objects use
one block for the PyUnicodeObject struct and another for its data
buffer. */
unsigned short compact:1;
unsigned char compact:1;
/* The string only contains characters in the range U+0000-U+007F (ASCII)
and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is
set, use the PyASCIIObject structure. */
unsigned short ascii:1;
unsigned char ascii:1;
/* The object is statically allocated. */
unsigned short statically_allocated:1;
unsigned char statically_allocated:1;
/* Padding to ensure that PyUnicode_DATA() is always aligned to
4 bytes (see issue #19537 on m68k) and we use unsigned short to avoid
the extra four bytes on 32-bit Windows. This is restricted features
for specific compilers including GCC, MSVC, Clang and IBM's XL compiler. */
unsigned short :10;
unsigned char :2;
unsigned char :8;
unsigned char :8;
} state;
} PyASCIIObject;

Expand Down
Loading
0