-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-139353: Rename formatter_unicode.c to unicode_formatter.c #139723
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
Conversation
* Move Python/formatter_unicode.c to Objects/unicode_formatter.c. * Move Objects/stringlib/localeutil.h content into unicode_formatter.c. Remove localeutil.h. * Move _PyUnicode_InsertThousandsGrouping() to unicode_formatter.c and mark the function as static. * Rename unicode_fill() to _PyUnicode_Fill() and export it in pycore_unicodeobject.h.
3e0f902
to
9fa57c5
Compare
@serhiy-storchaka: Is it what you asked for? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, lets go.
Please check that the formatting code that uses _PyUnicode_InsertThousandsGrouping()
does not struggle due to non-inlined _PyUnicode_Fill()
.
Objects/unicodeobject.c
Outdated
void | ||
_PyUnicode_Fill(int kind, void *data, Py_UCS4 value, | ||
Py_ssize_t start, Py_ssize_t length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that it will be inlined? Maybe keep static inline unicode_fill()
and add a wrapper _PyUnicode_Fill()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep static inline unicode_fill() and add a wrapper _PyUnicode_Fill()?
Ok, I implemented _PyUnicode_Fill() as a static inline function. So the compiler can decide to inline it or not.
I checked the Python 3.14 executable on Fedora which is built with PGO+LTO. I looked at
So in the Fedora package at least, |
Move MAX_UNICODE to pycore_unicodeobject.h as _Py_MAX_UNICODE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I did not suggest to make it inline. I only asked if this makes noticeable difference. Locale specific formatting is complex, so I think it would not, even if it was inlined previously, but we should check.
Anyway, LGTM. 👍
Uh oh!
There was an error while loading. Please reload this page.