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
d5989608
Commit
d5989608
authored
Apr 24, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PyString_InternFromString
parent
1fa8e88f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
src/runtime/str.cpp
src/runtime/str.cpp
+14
-2
No files found.
src/runtime/str.cpp
View file @
d5989608
...
...
@@ -343,11 +343,23 @@ extern "C" Box* strAdd(BoxedString* lhs, Box* _rhs) {
return
new
(
lhs
->
size
()
+
rhs
->
size
())
BoxedString
(
lhs
->
s
,
rhs
->
s
);
}
static
llvm
::
StringMap
<
Box
*>
interned_strings
;
extern
"C"
PyObject
*
PyString_InternFromString
(
const
char
*
s
)
noexcept
{
Py_FatalError
(
"unimplemented"
);
RELEASE_ASSERT
(
s
,
""
);
auto
it
=
interned_strings
.
find
(
s
);
if
(
it
==
interned_strings
.
end
())
{
Box
*
b
=
PyGC_AddRoot
(
boxString
(
s
));
assert
(
b
);
interned_strings
[
s
]
=
b
;
return
b
;
}
else
{
assert
(
it
->
second
);
return
it
->
second
;
}
}
extern
"C"
void
PyString_InternInPlace
(
PyObject
**
)
noexcept
{
extern
"C"
void
PyString_InternInPlace
(
PyObject
**
o
)
noexcept
{
Py_FatalError
(
"unimplemented"
);
}
...
...
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