summaryrefslogtreecommitdiff
path: root/src/shared_string.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2015-02-19 13:58:25 +0000
committerMaxime Coste <frrrwww@gmail.com>2015-02-19 13:58:25 +0000
commit8df77121d7afb38e7a5584d0f89f5d7237ebaac1 (patch)
tree81a6eb072d07953ac8d47b60ded015ab49757e14 /src/shared_string.hh
parent6c65c5e080d381bb713172976847baad5650e24b (diff)
Rename safe_ptr and ref_ptr to SafePtr and RefPtr
Diffstat (limited to 'src/shared_string.hh')
-rw-r--r--src/shared_string.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shared_string.hh b/src/shared_string.hh
index f9adf737..a73f8dd2 100644
--- a/src/shared_string.hh
+++ b/src/shared_string.hh
@@ -44,7 +44,7 @@ struct StringStorage : UseMemoryDomain<MemoryDomain::SharedString>
friend void dec_ref_count(StringStorage* s) { if (--s->refcount == 0) StringStorage::destroy(s); }
};
-inline ref_ptr<StringStorage> operator"" _ss(const char* ptr, size_t len)
+inline RefPtr<StringStorage> operator"" _ss(const char* ptr, size_t len)
{
return StringStorage::create({ptr, (int)len});
}
@@ -75,15 +75,15 @@ public:
return SharedString{StringView::substr(from, length), m_storage};
}
- explicit SharedString(ref_ptr<StringStorage> storage)
+ explicit SharedString(RefPtr<StringStorage> storage)
: StringView{storage->strview()}, m_storage(std::move(storage)) {}
private:
- SharedString(StringView str, ref_ptr<StringStorage> storage)
+ SharedString(StringView str, RefPtr<StringStorage> storage)
: StringView{str}, m_storage(std::move(storage)) {}
friend class StringRegistry;
- ref_ptr<StringStorage> m_storage;
+ RefPtr<StringStorage> m_storage;
};
inline size_t hash_value(const SharedString& str)
@@ -99,7 +99,7 @@ public:
void purge_unused();
private:
- UnorderedMap<StringView, ref_ptr<StringStorage>, MemoryDomain::SharedString> m_strings;
+ UnorderedMap<StringView, RefPtr<StringStorage>, MemoryDomain::SharedString> m_strings;
};
inline SharedString intern(StringView str)