diff options
author | Ian Henriksen <insertinterestingnamehere@gmail.com> | 2021-07-07 23:26:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 23:26:06 (GMT) |
commit | fed2fc4443235fa9669b73817827fd6da88e3417 (patch) | |
tree | be605df67caa5ea9f5f5ab98b87b03cba69e53ee /Python/dynload_shlib.c | |
parent | 052930f2416323ca0488b86baad7944d62e79e7f (diff) | |
download | cpython-fed2fc4443235fa9669b73817827fd6da88e3417.zip cpython-fed2fc4443235fa9669b73817827fd6da88e3417.tar.gz cpython-fed2fc4443235fa9669b73817827fd6da88e3417.tar.bz2 |
bpo-43895: Remove an unnecessary cache of shared object handles (GH-25487)
* Remove an unnecessary cache of shared object handles.
Diffstat (limited to 'Python/dynload_shlib.c')
-rw-r--r-- | Python/dynload_shlib.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 2382889..3c5fd83 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -48,13 +48,6 @@ const char *_PyImport_DynLoadFiletab[] = { NULL, }; -static struct { - dev_t dev; - ino_t ino; - void *handle; -} handles[128]; -static int nhandles = 0; - dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix, @@ -77,22 +70,9 @@ _PyImport_FindSharedFuncptr(const char *prefix, LEAD_UNDERSCORE "%.20s_%.200s", prefix, shortname); if (fp != NULL) { - int i; struct _Py_stat_struct status; if (_Py_fstat(fileno(fp), &status) == -1) return NULL; - for (i = 0; i < nhandles; i++) { - if (status.st_dev == handles[i].dev && - status.st_ino == handles[i].ino) { - p = (dl_funcptr) dlsym(handles[i].handle, - funcname); - return p; - } - } - if (nhandles < 128) { - handles[nhandles].dev = status.st_dev; - handles[nhandles].ino = status.st_ino; - } } dlopenflags = _PyInterpreterState_GET()->dlopenflags; @@ -126,8 +106,6 @@ _PyImport_FindSharedFuncptr(const char *prefix, Py_DECREF(path); return NULL; } - if (fp != NULL && nhandles < 128) - handles[nhandles++].handle = handle; p = (dl_funcptr) dlsym(handle, funcname); return p; } |