Skip to content

Commit 14cbd0e

Browse files
authored
remove unused _PyFunction_LookupByVersion (GH-144814)
1 parent 5922149 commit 14cbd0e

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

Include/internal/pycore_function.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ _PyFunction_IsVersionValid(uint32_t version)
3030
extern uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
3131
PyAPI_FUNC(void) _PyFunction_SetVersion(PyFunctionObject *func, uint32_t version);
3232
void _PyFunction_ClearCodeByVersion(uint32_t version);
33-
PyFunctionObject *_PyFunction_LookupByVersion(uint32_t version, PyObject **p_code);
3433

3534
extern PyObject *_Py_set_function_type_params(
3635
PyThreadState* unused, PyObject *func, PyObject *type_params);

Objects/funcobject.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -373,32 +373,6 @@ _PyFunction_ClearCodeByVersion(uint32_t version)
373373
#endif
374374
}
375375

376-
PyFunctionObject *
377-
_PyFunction_LookupByVersion(uint32_t version, PyObject **p_code)
378-
{
379-
#ifdef Py_GIL_DISABLED
380-
return NULL;
381-
#else
382-
PyInterpreterState *interp = _PyInterpreterState_GET();
383-
struct _func_version_cache_item *slot = get_cache_item(interp, version);
384-
if (slot->code) {
385-
assert(PyCode_Check(slot->code));
386-
PyCodeObject *code = (PyCodeObject *)slot->code;
387-
if (code->co_version == version) {
388-
*p_code = slot->code;
389-
}
390-
}
391-
else {
392-
*p_code = NULL;
393-
}
394-
if (slot->func && slot->func->func_version == version) {
395-
assert(slot->func->func_code == slot->code);
396-
return slot->func;
397-
}
398-
return NULL;
399-
#endif
400-
}
401-
402376
uint32_t
403377
_PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
404378
{

Python/optimizer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include "pycore_bitutils.h" // _Py_popcount32()
99
#include "pycore_ceval.h" // _Py_set_eval_breaker_bit
1010
#include "pycore_code.h" // _Py_GetBaseCodeUnit
11-
#include "pycore_function.h" // _PyFunction_LookupByVersion()
1211
#include "pycore_interpframe.h"
1312
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
1413
#include "pycore_opcode_metadata.h" // _PyOpcode_OpName[]

0 commit comments

Comments
 (0)