Skip to content

Commit 7d40869

Browse files
authored
remove unnecessary tp_dealloc (GH-13647)
1 parent ca80495 commit 7d40869

File tree

4 files changed

+4
-30
lines changed

4 files changed

+4
-30
lines changed

Objects/bytesobject.c

+1-9
Original file line numberDiff line numberDiff line change
@@ -1077,14 +1077,6 @@ _PyBytes_FormatEx(const char *format, Py_ssize_t format_len,
10771077
return NULL;
10781078
}
10791079

1080-
/* =-= */
1081-
1082-
static void
1083-
bytes_dealloc(PyObject *op)
1084-
{
1085-
Py_TYPE(op)->tp_free(op);
1086-
}
1087-
10881080
/* Unescape a backslash-escaped string. If unicode is non-zero,
10891081
the string is a u-literal. If recode_encoding is non-zero,
10901082
the string is UTF-8 encoded and should be re-encoded in the
@@ -2875,7 +2867,7 @@ PyTypeObject PyBytes_Type = {
28752867
"bytes",
28762868
PyBytesObject_SIZE,
28772869
sizeof(char),
2878-
bytes_dealloc, /* tp_dealloc */
2870+
0, /* tp_dealloc */
28792871
0, /* tp_print */
28802872
0, /* tp_getattr */
28812873
0, /* tp_setattr */

Objects/complexobject.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,6 @@ PyComplex_AsCComplex(PyObject *op)
343343
}
344344
}
345345

346-
static void
347-
complex_dealloc(PyObject *op)
348-
{
349-
op->ob_type->tp_free(op);
350-
}
351-
352346
static PyObject *
353347
complex_repr(PyComplexObject *v)
354348
{
@@ -1118,7 +1112,7 @@ PyTypeObject PyComplex_Type = {
11181112
"complex",
11191113
sizeof(PyComplexObject),
11201114
0,
1121-
complex_dealloc, /* tp_dealloc */
1115+
0, /* tp_dealloc */
11221116
0, /* tp_print */
11231117
0, /* tp_getattr */
11241118
0, /* tp_setattr */

Objects/longobject.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -3053,12 +3053,6 @@ PyLong_AsDouble(PyObject *v)
30533053

30543054
/* Methods */
30553055

3056-
static void
3057-
long_dealloc(PyObject *v)
3058-
{
3059-
Py_TYPE(v)->tp_free(v);
3060-
}
3061-
30623056
static int
30633057
long_compare(PyLongObject *a, PyLongObject *b)
30643058
{
@@ -5628,7 +5622,7 @@ PyTypeObject PyLong_Type = {
56285622
"int", /* tp_name */
56295623
offsetof(PyLongObject, ob_digit), /* tp_basicsize */
56305624
sizeof(digit), /* tp_itemsize */
5631-
long_dealloc, /* tp_dealloc */
5625+
0, /* tp_dealloc */
56325626
0, /* tp_print */
56335627
0, /* tp_getattr */
56345628
0, /* tp_setattr */

Objects/unicodeobject.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -8099,19 +8099,13 @@ static PyMethodDef encoding_map_methods[] = {
80998099
{ 0 }
81008100
};
81018101

8102-
static void
8103-
encoding_map_dealloc(PyObject* o)
8104-
{
8105-
PyObject_FREE(o);
8106-
}
8107-
81088102
static PyTypeObject EncodingMapType = {
81098103
PyVarObject_HEAD_INIT(NULL, 0)
81108104
"EncodingMap", /*tp_name*/
81118105
sizeof(struct encoding_map), /*tp_basicsize*/
81128106
0, /*tp_itemsize*/
81138107
/* methods */
8114-
encoding_map_dealloc, /*tp_dealloc*/
8108+
0, /*tp_dealloc*/
81158109
0, /*tp_print*/
81168110
0, /*tp_getattr*/
81178111
0, /*tp_setattr*/

0 commit comments

Comments
 (0)