Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
510492e9
Commit
510492e9
authored
Apr 12, 2002
by
Neil Schemenauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove PyMalloc_New, _PyMalloc_MALLOC, and PyMalloc_Del.
parent
9acae5a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
Objects/stringobject.c
Objects/stringobject.c
+7
-7
No files found.
Objects/stringobject.c
View file @
510492e9
...
...
@@ -64,7 +64,7 @@ PyString_FromStringAndSize(const char *str, int size)
/* PyObject_NewVar is inlined */
op
=
(
PyStringObject
*
)
_PyMalloc
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
PyObject
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
if
(
op
==
NULL
)
return
PyErr_NoMemory
();
PyObject_INIT_VAR
(
op
,
&
PyString_Type
,
size
);
...
...
@@ -120,7 +120,7 @@ PyString_FromString(const char *str)
/* PyObject_NewVar is inlined */
op
=
(
PyStringObject
*
)
_PyMalloc
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
PyObject
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
if
(
op
==
NULL
)
return
PyErr_NoMemory
();
PyObject_INIT_VAR
(
op
,
&
PyString_Type
,
size
);
...
...
@@ -717,7 +717,7 @@ string_concat(register PyStringObject *a, register PyObject *bb)
size
=
a
->
ob_size
+
b
->
ob_size
;
/* PyObject_NewVar is inlined */
op
=
(
PyStringObject
*
)
_PyMalloc
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
PyObject
_MALLOC
(
sizeof
(
PyStringObject
)
+
size
*
sizeof
(
char
));
if
(
op
==
NULL
)
return
PyErr_NoMemory
();
PyObject_INIT_VAR
(
op
,
&
PyString_Type
,
size
);
...
...
@@ -760,7 +760,7 @@ string_repeat(register PyStringObject *a, register int n)
return
NULL
;
}
op
=
(
PyStringObject
*
)
_PyMalloc
_MALLOC
(
sizeof
(
PyStringObject
)
+
nbytes
);
PyObject
_MALLOC
(
sizeof
(
PyStringObject
)
+
nbytes
);
if
(
op
==
NULL
)
return
PyErr_NoMemory
();
PyObject_INIT_VAR
(
op
,
&
PyString_Type
,
size
);
...
...
@@ -2755,7 +2755,7 @@ PyTypeObject PyString_Type = {
0
,
/* tp_init */
0
,
/* tp_alloc */
string_new
,
/* tp_new */
_PyMalloc_Del
,
/* tp_free */
PyObject_Del
,
/* tp_free */
};
void
...
...
@@ -2807,10 +2807,10 @@ _PyString_Resize(PyObject **pv, int newsize)
#endif
_Py_ForgetReference
(
v
);
*
pv
=
(
PyObject
*
)
_PyMalloc
_REALLOC
((
char
*
)
v
,
PyObject
_REALLOC
((
char
*
)
v
,
sizeof
(
PyStringObject
)
+
newsize
*
sizeof
(
char
));
if
(
*
pv
==
NULL
)
{
Py
Malloc
_Del
(
v
);
Py
Object
_Del
(
v
);
PyErr_NoMemory
();
return
-
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment