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
3d01a810
Commit
3d01a810
authored
Jul 21, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Can simplify InternedStringPool"
This reverts commit
c78fdcb9
.
parent
aa9869df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/core/stringpool.cpp
src/core/stringpool.cpp
+13
-2
src/core/stringpool.h
src/core/stringpool.h
+6
-0
No files found.
src/core/stringpool.cpp
View file @
3d01a810
...
...
@@ -19,8 +19,19 @@
namespace
pyston
{
InternedString
InternedStringPool
::
get
(
llvm
::
StringRef
arg
)
{
// HACK: should properly track this liveness:
BoxedString
*
s
=
internStringImmortal
(
arg
);
auto
it
=
interned
.
find
(
arg
);
BoxedString
*
s
;
if
(
it
!=
interned
.
end
())
{
s
=
it
->
second
;
}
else
{
// HACK: should properly track this liveness:
s
=
internStringImmortal
(
arg
);
// Note: make sure the key points to the value we just created, not the
// argument string:
interned
[
s
->
s
()]
=
s
;
}
#ifndef NDEBUG
return
InternedString
(
s
,
this
);
...
...
src/core/stringpool.h
View file @
3d01a810
...
...
@@ -89,6 +89,12 @@ public:
};
class
InternedStringPool
{
private:
// We probably don't need to pull in llvm::StringRef as the key, but it's better than std::string
// which I assume forces extra allocations.
// (We could define a custom string-pointer container but is it worth it?)
std
::
unordered_map
<
llvm
::
StringRef
,
BoxedString
*>
interned
;
public:
void
gcHandler
(
gc
::
GCVisitor
*
v
);
InternedString
get
(
llvm
::
StringRef
s
);
...
...
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