gh-139353: Rename formatter_unicode.c to unicode_formatter.c#139723
gh-139353: Rename formatter_unicode.c to unicode_formatter.c#139723vstinner merged 3 commits intopython:mainfrom
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? |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.
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.
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.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.