]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38896: Remove PyUnicode_ClearFreeList() function (GH-17354)
authorVictor Stinner <vstinner@python.org>
Sat, 23 Nov 2019 01:30:32 +0000 (02:30 +0100)
committerGitHub <noreply@github.com>
Sat, 23 Nov 2019 01:30:32 +0000 (02:30 +0100)
Remove PyUnicode_ClearFreeList() function: the Unicode free list has
been removed in Python 3.3.

Doc/c-api/unicode.rst
Doc/whatsnew/3.9.rst
Include/unicodeobject.h
Misc/NEWS.d/next/C API/2019-11-22-19-43-43.bpo-38896.6wvNMJ.rst [new file with mode: 0644]
Modules/gcmodule.c
Objects/unicodeobject.c
PC/python3.def

index 2bf4a0f56bc8a3a344ea677f1b00cdf501050166..77f123cf1f2c08c1bf117cdab6f1e1383aa2c785 100644 (file)
@@ -197,11 +197,6 @@ access internal read-only data of Unicode objects:
    .. versionadded:: 3.3
 
 
-.. c:function:: int PyUnicode_ClearFreeList()
-
-   Clear the free list. Return the total number of freed items.
-
-
 .. c:function:: Py_ssize_t PyUnicode_GET_SIZE(PyObject *o)
 
    Return the size of the deprecated :c:type:`Py_UNICODE` representation, in
index 281173edb895b3e6944f96ad81fd16f86a0e1808..a3ad98d020642e462fcd54947ed878b7e256d8aa 100644 (file)
@@ -235,6 +235,10 @@ Build and C API Changes
   functions: the free lists of bound method objects have been removed.
   (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`.)
 
+* Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free list has been
+  removed in Python 3.3.
+  (Contributed by Victor Stinner in :issue:`38896`.)
+
 
 Deprecated
 ==========
index 97d8cd12f6de5494a1c32140ade1857c47c89020..4dea4942181225e9ec5b6f797d1d970868729ef4 100644 (file)
@@ -328,17 +328,6 @@ PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
 
 PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
 
-/* --- Free-list management ----------------------------------------------- */
-
-/* Clear the free list used by the Unicode implementation.
-
-   This can be used to release memory used for objects on the free
-   list back to the Python memory allocator.
-
-*/
-
-PyAPI_FUNC(int) PyUnicode_ClearFreeList(void);
-
 /* === Builtin Codecs =====================================================
 
    Many of these APIs take two arguments encoding and errors. These
diff --git a/Misc/NEWS.d/next/C API/2019-11-22-19-43-43.bpo-38896.6wvNMJ.rst b/Misc/NEWS.d/next/C API/2019-11-22-19-43-43.bpo-38896.6wvNMJ.rst
new file mode 100644 (file)
index 0000000..c5e108d
--- /dev/null
@@ -0,0 +1,2 @@
+Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free list has
+been removed in Python 3.3.
index d232179a11ce4d7044670267b587e5e56de4706c..64afe831c84c51f18dd85591d3a30ebb7cb72392 100644 (file)
@@ -1031,7 +1031,6 @@ clear_freelists(void)
 {
     (void)PyFrame_ClearFreeList();
     (void)PyTuple_ClearFreeList();
-    (void)PyUnicode_ClearFreeList();
     (void)PyFloat_ClearFreeList();
     (void)PyList_ClearFreeList();
     (void)PyDict_ClearFreeList();
index 89e45d01e3789e06551ef151fe62f1205703a748..77760195b32e79f110cdecb8c87b49146b0a23f5 100644 (file)
@@ -15332,14 +15332,6 @@ _PyUnicode_Init(void)
     return _PyStatus_OK();
 }
 
-/* Finalize the Unicode implementation */
-
-int
-PyUnicode_ClearFreeList(void)
-{
-    return 0;
-}
-
 
 void
 PyUnicode_InternInPlace(PyObject **p)
@@ -15951,7 +15943,6 @@ _PyUnicode_Fini(PyThreadState *tstate)
             Py_CLEAR(unicode_latin1[i]);
         }
         _PyUnicode_ClearStaticStrings();
-        (void)PyUnicode_ClearFreeList();
     }
 
     PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE();
index 1f355bffc9bdd03e3171c99ff39fc5e29e58c5da..4689b777a6933b1ec4a8a976b6b71590237fd38e 100644 (file)
@@ -649,7 +649,6 @@ EXPORTS
   PyUnicode_AsWideChar=python39.PyUnicode_AsWideChar
   PyUnicode_AsWideCharString=python39.PyUnicode_AsWideCharString
   PyUnicode_BuildEncodingMap=python39.PyUnicode_BuildEncodingMap
-  PyUnicode_ClearFreeList=python39.PyUnicode_ClearFreeList
   PyUnicode_Compare=python39.PyUnicode_Compare
   PyUnicode_CompareWithASCIIString=python39.PyUnicode_CompareWithASCIIString
   PyUnicode_Concat=python39.PyUnicode_Concat