diff options
author | Victor Stinner <vstinner@python.org> | 2024-02-20 23:16:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 22:16:37 +0000 |
commit | 52d14775665a6fde518ee3da88a73f39b09d993f (patch) | |
tree | 7aa83b307d5af59761a769d4a54746b7a7c81fc2 /Python/gc.c | |
parent | e1fdc3c323bd605f92622b7ee18805885ff0bb4e (diff) | |
download | cpython-52d14775665a6fde518ee3da88a73f39b09d993f.tar.gz cpython-52d14775665a6fde518ee3da88a73f39b09d993f.zip |
gh-110850: Rename internal PyTime C API functions (#115734)
Rename functions:
* _PyTime_GetSystemClock() => _PyTime_TimeUnchecked()
* _PyTime_GetPerfCounter() => _PyTime_PerfCounterUnchecked()
* _PyTime_GetMonotonicClock() => _PyTime_MonotonicUnchecked()
* _PyTime_GetSystemClockWithInfo() => _PyTime_TimeWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
Changes:
* Remove "typedef PyTime_t PyTime_t;" which was
"typedef PyTime_t _PyTime_t;" before a previous rename.
* Update comments of "Unchecked" functions.
* Remove invalid PyTime_Time() comment.
Diffstat (limited to 'Python/gc.c')
-rw-r--r-- | Python/gc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/gc.c b/Python/gc.c index 907f29baa37..a031897d235 100644 --- a/Python/gc.c +++ b/Python/gc.c @@ -12,7 +12,7 @@ #include "pycore_object_alloc.h" // _PyObject_MallocWithType() #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_time.h" // _PyTime_GetPerfCounter() +#include "pycore_time.h" // _PyTime_PerfCounterUnchecked() #include "pycore_weakref.h" // _PyWeakref_ClearRef() #include "pydtrace.h" @@ -1327,7 +1327,7 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason) if (gcstate->debug & _PyGC_DEBUG_STATS) { PySys_WriteStderr("gc: collecting generation %d...\n", generation); show_stats_each_generations(gcstate); - t1 = _PyTime_GetPerfCounter(); + t1 = _PyTime_PerfCounterUnchecked(); } if (PyDTrace_GC_START_ENABLED()) { @@ -1428,7 +1428,7 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason) debug_cycle("uncollectable", FROM_GC(gc)); } if (gcstate->debug & _PyGC_DEBUG_STATS) { - double d = _PyTime_AsSecondsDouble(_PyTime_GetPerfCounter() - t1); + double d = _PyTime_AsSecondsDouble(_PyTime_PerfCounterUnchecked() - t1); PySys_WriteStderr( "gc: done, %zd unreachable, %zd uncollectable, %.4fs elapsed\n", n+m, n, d); |