Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
ccac5408
Commit
ccac5408
authored
Jul 02, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reenable PyString_GET_SIZE
parent
dc1f1d6c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
13 deletions
+1
-13
from_cpython/Include/stringobject.h
from_cpython/Include/stringobject.h
+1
-3
src/runtime/str.cpp
src/runtime/str.cpp
+0
-10
No files found.
from_cpython/Include/stringobject.h
View file @
ccac5408
...
...
@@ -112,10 +112,8 @@ PyAPI_FUNC(int) _PyString_CheckInterned(PyObject *) PYSTON_NOEXCEPT;
// length of the unicode string, not the length of the bytes it encodes to in the default
// encoding.
// So, set up a different function for those callers to use.
PyAPI_FUNC
(
Py_ssize_t
)
_PyString_SizeMacro
(
PyObject
*
)
PYSTON_NOEXCEPT
;
#define PyString_GET_SIZE(op) _PyString_SizeMacro((PyObject*)op)
//#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
//
#define PyString_GET_SIZE(op) Py_SIZE(op)
#define PyString_GET_SIZE(op) Py_SIZE(op)
/* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*,
x must be an iterable object. */
...
...
src/runtime/str.cpp
View file @
ccac5408
...
...
@@ -2348,16 +2348,6 @@ extern "C" Py_ssize_t PyString_Size(PyObject* op) noexcept {
return
len
;
}
extern
"C"
Py_ssize_t
_PyString_SizeMacro
(
PyObject
*
op
)
noexcept
{
if
(
PyString_Check
(
op
))
return
static_cast
<
BoxedString
*>
(
op
)
->
size
();
if
(
PyUnicode_Check
(
op
))
return
Py_SIZE
(
op
);
RELEASE_ASSERT
(
0
,
"Need to verify the behavior of PyString_GET_SIZE on %s objects"
,
op
->
cls
->
tp_name
);
}
extern
"C"
int
_PyString_Resize
(
PyObject
**
pv
,
Py_ssize_t
newsize
)
noexcept
{
// This is only allowed to be called when there is only one user of the string (ie a refcount of 1 in CPython)
...
...
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