Index: /trunk/nv/core/types.hh
===================================================================
--- /trunk/nv/core/types.hh	(revision 428)
+++ /trunk/nv/core/types.hh	(revision 429)
@@ -13,5 +13,6 @@
 #include <nv/stl/vector.hh>
 #include <nv/stl/unordered_map.hh>
-#include <nv/stl/cstring_store.hh>
+#include <nv/stl/string_table.hh>
+#include <nv/stl/functional/hash.hh>
 #include <nv/stl/type_traits/properties.hh>
 
@@ -55,5 +56,5 @@
 	struct type_field
 	{
-		uint32      name;     //!< name of the field
+		uint64  name;     //!< name of the field
 		type_hash   hash; //!< typeinfo for later retrieval of type
 		type_entry* type;     //!< pointer to field type
@@ -64,5 +65,5 @@
 	struct type_enum
 	{
-		uint32 name;
+		uint64 name;
 		sint32 value;
 	};
@@ -75,5 +76,5 @@
 
 		type_database*          type_db;     //!< Parent type database
-		uint32                  name;        //!< Scoped C++ name of the type
+		uint64                  name;        //!< Scoped C++ name of the type
 		constructor_func        constructor; //!< Pointers to the constructor 
 		destructor_func         destructor;  //!< Pointers to the destructor 
@@ -82,5 +83,4 @@
 		vector<type_field> field_list;  //!< Field list
 		vector<type_enum>  enum_list;   //!< Enum list
-		cstring_store names;
 	};
 
@@ -109,17 +109,20 @@
 	{
 	public:
+		friend class type_creator;
+
 		template< typename TYPE >
 		type_creator create_type( const char* name )
 		{
 			NV_ASSERT( !m_names.exists( name ), "Type redefinition!" );
-			uint32 name_idx = m_names.push( name );
+			uint64 name_hash = m_names.insert( name );
 			type_entry* i_type = new type_entry;
 			i_type->type_db = this;
-			i_type->name = name_idx;
+			i_type->name = name_hash;
 			i_type->size = sizeof( TYPE );
 
 			i_type->constructor = raw_construct_object < TYPE >;
 			i_type->destructor  = raw_destroy_object < TYPE >;
-			m_idx_types[typeid( TYPE )] = i_type;
+			m_index_by_type[typeid( TYPE )] = i_type;
+			m_index_by_name[name_hash] = i_type;
 			m_type_list.push_back( i_type );
 			return type_creator( this, i_type );
@@ -128,16 +131,13 @@
 		type_entry* get_type( const char* name )
 		{
-			uint32 name_idx = m_names.resolve( name );
-			if ( name_idx < m_type_list.size() )
-			{
-				return m_type_list[name_idx];
-			}
-			return nullptr;
+			uint64 name_hash = hash_string<type_hash>( name );
+			auto it = m_index_by_name.find( name_hash );
+			return it != m_index_by_name.end() ? it->second : nullptr;
 		}
 
 		type_entry* get_type( type_hash hash )
 		{
-			type_info_map::iterator it = m_idx_types.find( hash );
-			if ( it != m_idx_types.end() )
+			type_hash_map::iterator it = m_index_by_type.find( hash );
+			if ( it != m_index_by_type.end() )
 			{
 				return it->second;
@@ -146,7 +146,7 @@
 		}
 
-		const char* resolve_name( uint32 name_idx )
-		{
-			return m_names.get( name_idx );
+		string_view resolve_name( uint64 name_hash )
+		{
+			return m_names[name_hash];
 		}
 
@@ -157,8 +157,9 @@
 	private:
 		typedef vector<type_entry*>                   type_list;
-		typedef unordered_map<type_hash, type_entry*> type_info_map;
-		cstring_store m_names;
+		typedef unordered_map<type_hash, type_entry*> type_hash_map;
+		string_table  m_names;
 		type_list     m_type_list;
-		type_info_map m_idx_types;
+		type_hash_map m_index_by_type;
+		type_hash_map m_index_by_name;
 	};
 	
@@ -176,5 +177,5 @@
 		NV_ASSERT( m_entry->enum_list.empty(), "Type cannot have both enums and fields!" );
 		type_field f;
-		f.name = m_entry->names.insert( name );
+		f.name = m_database->m_names.insert( name );
 		f.hash = rtti_type_hash< remove_pointer_t<field_type> >::hash();
 		f.type = type_db->get_type( f.hash );
@@ -192,5 +193,5 @@
 		NV_ASSERT( m_entry->enum_list.empty(), "Type cannot have both enums and fields!" );
 		type_field f;
-		f.name = m_entry->names.insert( name );
+		f.name = m_database->m_names.insert( name );
 		f.hash = rtti_type_hash< remove_pointer_t<TFIELD> >::hash();
 		f.type = type_db->get_type( f.hash );
@@ -207,5 +208,5 @@
 		NV_ASSERT( m_entry->field_list.empty(), "Type cannot have both enums and fields!" );
 		type_enum e;
-		e.name = m_entry->names.insert( name );
+		e.name = m_database->m_names.insert( name );
 		e.value = value;
 		m_entry->enum_list.push_back( e );
Index: unk/nv/stl/cstring_store.hh
===================================================================
--- /trunk/nv/stl/cstring_store.hh	(revision 428)
+++ 	(revision )
@@ -1,119 +1,0 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd
-// http://chaosforge.org/
-//
-// This file is part of Nova libraries. 
-// For conditions of distribution and use, see copying.txt file in root folder.
-
-/**
-* @file cstring_store.hh
-* @author Kornel Kisielewicz
-* @brief cstring_store
-*/
-
-#ifndef NV_STL_CSTRING_STORE_HH
-#define NV_STL_CSTRING_STORE_HH
-
-#include <nv/common.hh>
-#include <nv/stl/unordered_map.hh>
-#include <nv/stl/array.hh>
-
-namespace nv
-{
-
-	namespace detail
-	{
-
-		inline char *cstring_duplicate( const char *s )
-		{
-			size_t length = nvstrlen( s ) + 1;
-			void *result = nvmalloc( length );
-			if ( result == nullptr ) return nullptr;
-			return (char *)nvmemcpy( result, s, length );
-		}
-
-		struct cstring_compare
-		{
-			bool operator()( const char* lhs, const char* rhs ) const
-			{
-				return nvstrcmp( lhs, rhs ) == 0;
-			}
-		};
-
-
-		struct cstring_hash
-		{
-			int operator()( const char* str ) const
-			{
-				int seed = 131;
-				int hash = 0;
-				while ( *str )
-				{
-					hash = ( hash * seed ) + ( *str );
-					str++;
-				}
-				return hash & ( 0x7FFFFFFF );
-			}
-		};
-	}
-
-	template < typename T >
-	using cstring_unordered_map = unordered_map < const char*, T, detail::cstring_hash, detail::cstring_compare > ;
-
-	class cstring_store : public noncopyable
-	{
-	public:
-		cstring_store() {}
-
-		bool exists( const char* cstr )
-		{
-			return m_map.find( cstr ) != m_map.end();
-		}
-		
-		const char* get( uint32 index )
-		{
-			return index < m_array.size() ? m_array[index] : nullptr;
-		}
-
-		uint32 resolve( const char* cstr )
-		{
-			auto it = m_map.find( cstr );
-			if ( it != m_map.end() )
-			{
-				return it->second;
-			}
-			return uint32(-1);
-		}
-
-		uint32 push( const char* cstr )
-		{
-			char* duplicate = detail::cstring_duplicate( cstr );
-			m_array.push_back( duplicate );
-			uint32 index = (uint32)m_array.size() - 1;
-			m_map[duplicate] = index;
-			return index;
-		}
-
-		uint32 insert( const char* cstr )
-		{
-			auto it = m_map.find( cstr );
-			if ( it == m_map.end() )
-			{
-				return push( cstr );
-			}
-			return it->second;
-		}
-
-
-
-		~cstring_store()
-		{
-			for ( auto s : m_array ) free( s );
-		}
-	private:
-		vector< char* >                 m_array;
-		cstring_unordered_map< uint32 > m_map;
-	};
-
-}
-
-#endif // NV_STL_STRING_STORE_HH
