FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-41299: QueryPerformanceFrequency() cannot fail by vstinner · Pull Request #28552 · python/cpython · GitHub

/ cpython Public

bpo-41299: QueryPerformanceFrequency() cannot fail - #28552

Merged
vstinner merged 2 commits into
python:mainfrom
vstinner:perf_counter_freq
Sep 24, 2021
Merged

vstinner merged 2 commits into
python:mainfrom
vstinner:perf_counter_freq

Conversation

vstinner commented Sep 24, 2021 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

py_win_perf_counter_frequency() no longer checks for
QueryPerformanceFrequency() failure. According to the
QueryPerformanceFrequency() documentation, the function can no longer
fails since Windows XP.

https://bugs.python.org/issue41299

py_win_perf_counter_frequency() no longer checks for
QueryPerformanceFrequency() failure. According to the
QueryPerformanceFrequency() documentation, the function can no longer
fails since Windows XP.
Comment thread Python/pytime.c
return -1;
}
// Since Windows XP, the function cannot fail.
(void)QueryPerformanceFrequency(&freq);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why query this every time? It's fixed at boot, so it isn't going to change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This function must be called exactly once in a process: py_get_win_perf_counter() uses a static variable for that.

vstinner merged commit f35ddf2 into python:main Sep 24, 2021
vstinner deleted the perf_counter_freq branch September 24, 2021 22:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL