summaryrefslogtreecommitdiff
path: root/src/interned_string.cc
diff options
context:
space:
mode:
authorMaxime Coste <maxime.coste@havok.com>2015-01-13 13:58:11 +0000
committerMaxime Coste <maxime.coste@havok.com>2015-01-13 13:58:11 +0000
commit118a6e1a7cb0f9bb386e3130c7ad1f9dbcab6300 (patch)
treea225fbcb3edd7bcbc8f9460c158c74a9e173133b /src/interned_string.cc
parent61619a4d4d82cbf003523cbc4d605dcff99eb6ac (diff)
Use uint32_t for interned strings slots
Diffstat (limited to 'src/interned_string.cc')
-rw-r--r--src/interned_string.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interned_string.cc b/src/interned_string.cc
index fb6898c0..0755e3d4 100644
--- a/src/interned_string.cc
+++ b/src/interned_string.cc
@@ -28,7 +28,7 @@ InternedString StringRegistry::acquire(StringView str)
auto it = m_slot_map.find(str);
if (it == m_slot_map.end())
{
- size_t slot;
+ Slot slot;
if (not m_free_slots.empty())
{
slot = m_free_slots.back();
@@ -48,20 +48,20 @@ InternedString StringRegistry::acquire(StringView str)
return InternedString{storage_view, slot};
}
- size_t slot = it->second;
+ Slot slot = it->second;
auto& data = m_storage[slot];
++data.refcount;
return {{data.data.data(), (int)data.data.size()}, slot};
}
-void StringRegistry::acquire(size_t slot)
+void StringRegistry::acquire(Slot slot)
{
kak_assert(slot < m_storage.size());
kak_assert(m_storage[slot].refcount > 0);
++m_storage[slot].refcount;
}
-void StringRegistry::release(size_t slot) noexcept
+void StringRegistry::release(Slot slot) noexcept
{
kak_assert(m_storage[slot].refcount > 0);
if (--m_storage[slot].refcount == 0)