Index: trunk/src/engine/resource_system.cc
===================================================================
--- trunk/src/engine/resource_system.cc	(revision 439)
+++ trunk/src/engine/resource_system.cc	(revision 440)
@@ -12,6 +12,6 @@
 {
 	m_lua = a_lua_state;
-	std::string delete_me = "register_" + std::string( get_resource_name().data(), get_resource_name().size() );
-	lua::register_storage( m_lua, get_storage_name(), string_view( delete_me.c_str(), delete_me.size() ) );
+	string128 storage_name = "register_" + get_resource_name();
+	lua::register_storage( m_lua, get_storage_name(), storage_name );
 }
 
Index: trunk/src/formats/md5_loader.cc
===================================================================
--- trunk/src/formats/md5_loader.cc	(revision 439)
+++ trunk/src/formats/md5_loader.cc	(revision 440)
@@ -14,4 +14,6 @@
 #include <stdio.h>  // sscanf
 #include <stdlib.h> // atof
+
+#include <string> // TODO: remove
 
 using namespace nv;
Index: trunk/src/gui/gui_ascii_renderer.cc
===================================================================
--- trunk/src/gui/gui_ascii_renderer.cc	(revision 439)
+++ trunk/src/gui/gui_ascii_renderer.cc	(revision 440)
@@ -49,6 +49,5 @@
 		er->clear = true;
 		int color = 0;
-		std::string path;
-		std::string text;
+		string128 path;
 		const char* stext[] = { nullptr, "selected", "hover" };
 		const char* selector = stext[0];
Index: trunk/src/gui/gui_environment.cc
===================================================================
--- trunk/src/gui/gui_environment.cc	(revision 439)
+++ trunk/src/gui/gui_environment.cc	(revision 440)
@@ -9,6 +9,4 @@
 #include "nv/gui/gui_renderer.hh"
 
-#include <algorithm> // std::find on std::list
-
 	/*
 
@@ -27,4 +25,5 @@
 	: m_renderer( r )
 {
+	r->set_environment( this );
 	m_screen   = create_element( handle(), m_renderer->get_area() );
 }
@@ -161,5 +160,5 @@
 		while ( !parent->m_children.empty() )
 		{
-			destroy_element( parent->m_children.front() );
+			destroy_element( parent->m_children.back() );
 		}
 	}
@@ -196,4 +195,9 @@
 }
 
+nv::string_view nv::gui::environment::get_string( shash64 h )
+{
+	return m_strings[h];
+}
+
 bool nv::gui::environment::set_selected( handle e )
 {
@@ -235,5 +239,5 @@
 
 	handle result;
-	element::list::reverse_iterator it = el->m_children.rbegin();
+	auto it = el->m_children.rbegin();
 
 	while ( it != el->m_children.rend() )
@@ -254,5 +258,5 @@
 	if ( e && parent )
 	{
-		auto it = std::find( parent->m_children.begin(), parent->m_children.end(), child );
+		auto it = find( parent->m_children.begin(), parent->m_children.end(), child );
 		if ( it != parent->m_children.end() )
 		{
@@ -264,20 +268,4 @@
 }
 
-void nv::gui::environment::move_to_bottom( handle child )
-{
-	element* e      = m_elements.get( child );
-	element* parent = m_elements.get( e->m_parent );
-	if ( e && parent )
-	{
-		auto it = std::find( parent->m_children.begin(), parent->m_children.end(), child );
-		if ( it != parent->m_children.end() )
-		{
-			parent->m_children.erase( it );
-			parent->m_children.push_front( child );
-			parent->m_flags[DIRTY] = true;
-		}
-	}
-}
-
 void nv::gui::environment::set_relative( handle e, const rectangle& r )
 {
@@ -312,20 +300,20 @@
 }
 
-void nv::gui::environment::set_class( handle e, const std::string& text )
+void nv::gui::environment::set_class( handle e, const string_view& text )
 {
 	element* ep = m_elements.get(e);
 	if ( ep != nullptr )
 	{
-		ep->m_class        = text;
+		ep->m_class        = m_strings.insert( text );
 		ep->m_flags[DIRTY] = true;
 	}
 }
 
-void nv::gui::environment::set_text( handle e, const std::string& text )
+void nv::gui::environment::set_text( handle e, const string_twine& text )
 {
 	element* ep = m_elements.get(e);
 	if ( ep != nullptr )
 	{
-		ep->m_text         = text;
+		ep->m_text.assign( text );
 		ep->m_flags[DIRTY] = true;
 	}
@@ -337,12 +325,12 @@
 	if ( p )
 	{
-		auto it = std::find( p->m_children.begin(), p->m_children.end(), child );
+		auto it = find( p->m_children.begin(), p->m_children.end(), child );
 		if ( it != p->m_children.end() )
 		{
 			element* e = m_elements.get( *it );
 			e->m_parent = handle();
-			p->m_children.erase(it);
-		}	
-	}
-}
-
+			p->m_children.erase( it );
+		}
+	}
+}
+
Index: trunk/src/gui/gui_gfx_renderer.cc
===================================================================
--- trunk/src/gui/gui_gfx_renderer.cc	(revision 439)
+++ trunk/src/gui/gui_gfx_renderer.cc	(revision 440)
@@ -243,7 +243,6 @@
 		int border = 0;
 		vec4 color;
-		std::string path;
-		std::string text;
-		const char* stext[] = { nullptr, "selected", "hover" };
+		string128 path;
+		const char* stext[] = { "", "selected", "hover" };
 		const char* selector = stext[border];
 		if ( e->m_flags[HOVER] )    selector = stext[2];
@@ -252,5 +251,5 @@
 		if ( m_style.get( e, "skin", selector, path ) )
 		{
-			size_t image_id = load_image( string_view( path.c_str(), path.size() ) );
+			size_t image_id = load_image( path );
 			const image_info* image = get_image( image_id );
 			if ( image )
@@ -312,13 +311,13 @@
 		}
 
-		text = e->m_text;
-		if ( !text.empty() )
+		e->m_text;
+		if ( !e->m_text.empty() )
 		{
 			if ( m_style.get( e, "text_color", selector, color ) && m_style.get( e, "text_font", selector, path ) && m_style.get( e, "text_size", selector, border ) )
 			{
-				size_t font_id = load_font( string_view( path.c_str(), path.size() ), size_t( border ) );
+				size_t font_id = load_font( path, size_t( border ) );
 				texture_font* font = get_font( font_id );
 				position p = abs.ul + position( 0, border );
-				for ( char c : text )
+				for ( char c : e->m_text )
 				{
 					const texture_glyph* g = font->get_glyph( static_cast<uint16>( c ) );
Index: trunk/src/gui/gui_style.cc
===================================================================
--- trunk/src/gui/gui_style.cc	(revision 439)
+++ trunk/src/gui/gui_style.cc	(revision 440)
@@ -7,4 +7,5 @@
 #include "nv/gui/gui_style.hh"
 
+#include "nv/gui/gui_environment.hh"
 #include <nv/lua/lua_raw.hh>
 
@@ -12,25 +13,23 @@
 using namespace nv::gui;
 
-style::style()
-{
-}
-
 void style::load_style( const string_view& filename )
 {
+	NV_ASSERT_ALWAYS( m_env, "Environment not set in style!" );
 	m_lua.do_file( filename );
 }
 
-bool style::get( element* e, const char* centry, const char* cselector, std::string& s )
+bool style::get( element* e, const string_view& centry, const string_view& cselector, string128& s )
 {
 	lua::stack_guard guard( m_lua );
-	if ( !resolve( e->m_id.c_str(), e->m_class.c_str(), cselector, centry, LUA_TSTRING ) ) return false;
-	s = lua_tostring( m_lua, -1 );
+	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TSTRING ) ) return false;
+	// TODO: create lua_tostringbuffer< size >
+	s.assign( lua_tostring( m_lua, -1 ) );
 	return true;
 }
 
-bool style::get( element* e, const char* centry, const char* cselector, vec4& vec )
+bool style::get( element* e, const string_view& centry, const string_view& cselector, vec4& vec )
 {
 	lua::stack_guard guard( m_lua );
-	if ( !resolve( e->m_id.c_str(), e->m_class.c_str(), cselector, centry, LUA_TTABLE ) ) return false;
+	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TTABLE ) ) return false;
 	vec = vec4();
 	for ( int i = 0; i < 4; ++i )
@@ -44,16 +43,16 @@
 }
 
-bool style::get( element* e, const char* centry, const char* cselector, int& i )
+bool style::get( element* e, const string_view& centry, const string_view& cselector, int& i )
 {
 	lua::stack_guard guard( m_lua );
-	if ( !resolve( e->m_id.c_str(), e->m_class.c_str(), cselector, centry, LUA_TNUMBER ) ) return false;
+	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TNUMBER ) ) return false;
 	i = static_cast< int >( lua_tointeger( m_lua, -1 ) );
 	return true;
 }
 
-bool style::get( element* e, const char* centry, const char* cselector, double& d )
+bool style::get( element* e, const string_view& centry, const string_view& cselector, double& d )
 {
 	lua::stack_guard guard( m_lua );
-	if ( !resolve( e->m_id.c_str(), e->m_class.c_str(), cselector, centry, LUA_TNUMBER ) ) return false;
+	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TNUMBER ) ) return false;
 	d = lua_tonumber( m_lua, -1 );
 	return true;
@@ -64,14 +63,14 @@
 }
 
-bool style::find_entry( const char* cselector, const char* centry, int type )
+bool style::find_entry( const string_view& cselector, const string_view& centry, int type )
 {
 	if ( lua_istable( m_lua, -1 ) )
 	{
-		if ( cselector )
+		if ( !cselector.empty() )
 		{
-			lua_getfield( m_lua, -1, cselector );
+			lua_getfield( m_lua, -1, cselector.data() );
 			if ( lua_istable( m_lua, -1 ) )
 			{
-				lua_getfield( m_lua, -1, centry );
+				lua_getfield( m_lua, -1, centry.data() );
 				if ( lua_type( m_lua, -1 ) == type ) 
 				{
@@ -83,5 +82,5 @@
 		}
 
-		lua_getfield( m_lua, -1, centry );
+		lua_getfield( m_lua, -1, centry.data() );
 		if ( lua_type( m_lua, -1 ) == type ) return true;
 	}
@@ -89,5 +88,5 @@
 }
 
-bool style::resolve( const char* cid, const char* cclass, const char* cselector, const char* centry, int type )
+bool style::resolve( shash64 cid, shash64 cclass, const string_view& cselector, const string_view& centry, int type )
 {
 	lua_getglobal( m_lua, "default" );
@@ -95,12 +94,19 @@
 
 	// check id
-	lua_getfield( m_lua, -1, cid );
-	if ( find_entry( cselector, centry, type ) ) return true;
-	lua_settop( m_lua, global );
-
+	string_view id( m_env->get_string( cid ) );
+	if ( !id.empty() )
+	{
+		lua_getfield( m_lua, -1, id.data() );
+		if ( find_entry( cselector, centry, type ) ) return true;
+		lua_settop( m_lua, global );
+	}
 	// check class
-	lua_getfield( m_lua, -1, cclass );
-	if ( find_entry( cselector, centry, type ) ) return true;
-	lua_settop( m_lua, global );
+	string_view klass( m_env->get_string( cclass ) );
+	if ( !klass.empty() )
+	{
+		lua_getfield( m_lua, -1, klass.data() );
+		if ( find_entry( cselector, centry, type ) ) return true;
+		lua_settop( m_lua, global );
+	}
 
 	// check entry
Index: trunk/src/lib/gl.cc
===================================================================
--- trunk/src/lib/gl.cc	(revision 439)
+++ trunk/src/lib/gl.cc	(revision 440)
@@ -56,21 +56,24 @@
 
 
-static void* load_gl_ext_symbol_impl( const char* name, nv::log_level fail_level = nv::LOG_DEBUG )
-{
-	void* result = gl_ext_loader( name );
+static void* load_gl_ext_symbol_impl( const nv::string_view& name, nv::log_level fail_level = nv::LOG_DEBUG )
+{
+	void* result = gl_ext_loader( name.data() );
 	NV_LOG( ( result ? nv::LOG_DEBUG : fail_level ), "load_gl_ext_symbol : ", name, ( result ? " succeded." : "failed." ) );
 	return result;
 }
 
-static void* load_gl_ext_symbol( const char* name, bool iterate, const char* ext )
+static void* load_gl_ext_symbol( const nv::string_view& name, bool iterate, const nv::string_view& ext )
 {
 	void * result        = nullptr;
-	result = load_gl_ext_symbol_impl( ext ? ( std::string(name) + ext ).c_str() : name );
+	nv::string128 test_name = name + ext;
+	result = load_gl_ext_symbol_impl( !ext.empty() ? test_name : name );
 	if ( result ) return result;
 	if ( iterate )
 	{
-		result = gl_ext_loader( (std::string(name) + "ARB").c_str() );
+		test_name = name + "ARB"_ls;
+		result = gl_ext_loader( test_name.data() );
 		if ( result ) return result;
-		result = gl_ext_loader( (std::string(name) + "EXT").c_str() );
+		test_name = name + "EXT"_ls;
+		result = gl_ext_loader( test_name.data() );
 		if ( result ) return result;
 	}
@@ -255,5 +258,5 @@
 
 #	define NV_GL_FUN_EXT( rtype, symbol, fparams ) \
-	void_assign( symbol, load_gl_ext_symbol(#symbol, true, nullptr) ); \
+	void_assign( symbol, load_gl_ext_symbol(#symbol, true, string_view()) ); \
 	count++; if ( !symbol ) fail_count++;
 
Index: trunk/src/lua/lua_function.cc
===================================================================
--- trunk/src/lua/lua_function.cc	(revision 439)
+++ trunk/src/lua/lua_function.cc	(revision 440)
@@ -21,5 +21,5 @@
 	{
 		lua_pop( L, 1 );
-		NV_LUA_ABORT( "function_base::function_base", "not a valid path - ", a_path.to_string().c_str() );
+		NV_LUA_ABORT( "function_base::function_base", "not a valid path - ", a_path.to_string() );
 	}
 
@@ -27,5 +27,5 @@
 	{
 		lua_pop( L, 1 );
-		NV_LUA_ABORT( "function_base::function_base", "not a valid function - ", a_path.to_string().c_str() );
+		NV_LUA_ABORT( "function_base::function_base", "not a valid function - ", a_path.to_string() );
 	}
 	m_ref = luaL_ref( L, LUA_REGISTRYINDEX );
@@ -64,7 +64,7 @@
 	if ( status != 0 )
 	{
-		std::string error = lua_tostring( L, -1 );
+		string128 error( nlua_tostringview( L, -1 ) );
 		lua_pop( L, 1 );
-		NV_LUA_ABORT( "function_base::call", "call failed - ", error.c_str() );
+		NV_LUA_ABORT( "function_base::call", "call failed - ", error );
 	}
 }
Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 439)
+++ trunk/src/lua/lua_map_tile.cc	(revision 440)
@@ -16,4 +16,7 @@
 #include "nv/lua/lua_values.hh"
 #include "nv/lua/lua_raw.hh"
+
+// TODO: REMOVE
+#include <string>
 
 static const char* NLUA_MAP_TILE_METATABLE = "map_tile";
Index: trunk/src/lua/lua_path.cc
===================================================================
--- trunk/src/lua/lua_path.cc	(revision 439)
+++ trunk/src/lua/lua_path.cc	(revision 440)
@@ -74,37 +74,22 @@
 }
 
-std::string nv::lua::path::to_string() const
+string128 nv::lua::path::to_string() const
 {
-	char buffer[64];
-	char* start   = buffer;
-	char* current = buffer;
+	string128 buffer;
 	bool dot = false;
-	bool oos = false;
 	for ( const element& e : m_elements )
 	{
-		if ( current - start > 48 ) { oos = true; break; }
-		if ( dot ) *current++ = '.';
+		if ( dot ) buffer.append( "." );
 		if ( e.length == 0 )
 		{
-			*current++ = '[';
-			current += uint32_to_buffer( array_ref< char >( current, current - start ), e.value );
-			*current++ = ']';
+			buffer.append( "["_ls + e.value + "]"_ls );
 			dot = false;
 		}
 		else
 		{
-			if ( size_t(current - start) + e.length > 60 ) { oos = true; break; }
-			nvmemcpy( current, e.str, e.length );
-			current += e.length;
+			buffer.append( e.str, e.length );
 			dot = true;
 		}
 	}
-	if (oos) 
-	{ 
-		*current++ = '.';
-		*current++ = '.';
-		*current++ = '.';
-	}
-	*current++ = '\0';
-	return std::string( buffer, size_t(current - start - 1) );
+	return buffer;
 }
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 439)
+++ trunk/src/lua/lua_state.cc	(revision 440)
@@ -116,5 +116,5 @@
 	if ( !p.resolve( m_state, global ) )
 	{
-		NV_LOG_ERROR( "Lua error : not a valid path - ", p.to_string().c_str() );
+		NV_LOG_ERROR( "Lua error : not a valid path - ", p.to_string() );
 		return false;
 	}
@@ -123,5 +123,5 @@
 	{
 		lua_pop( m_state, 1 );
-		NV_LOG_ERROR( "Lua error : not a valid function - ", p.to_string().c_str() );
+		NV_LOG_ERROR( "Lua error : not a valid function - ", p.to_string() );
 		return false;
 	}
@@ -212,23 +212,4 @@
 	lua_pop( m_state, 1 );
 	return shash64( result );
-}
-
-std::string lua::table_guard::get_std_string( string_view element, string_view defval /*= string_view() */ )
-{
-	lua_getfield( m_state, -1, element.data() );
-	size_t l = 0;
-	const char* str = nullptr;
-	if ( lua_type( m_state, -1 ) == LUA_TSTRING )
-	{
-		str = lua_tolstring( m_state, -1, &l );
-	}
-	else
-	{
-		l = defval.size();
-		str = defval.data();
-	}
-	std::string result( str, l );
-	lua_pop( m_state, 1 );
-	return result;
 }
 
@@ -250,4 +231,23 @@
  	lua_pop( m_state, 1 );
  	return result;
+}
+
+string128 lua::table_guard::get_string128( string_view element, string_view defval )
+{
+	lua_getfield( m_state, -1, element.data() );
+	size_t l = 0;
+	const char* str = nullptr;
+	if ( lua_type( m_state, -1 ) == LUA_TSTRING )
+	{
+		str = lua_tolstring( m_state, -1, &l );
+	}
+	else
+	{
+		l = defval.size();
+		str = defval.data();
+	}
+	string128 result( str, l );
+	lua_pop( m_state, 1 );
+	return result;
 }
 
Index: trunk/src/lua/lua_values.cc
===================================================================
--- trunk/src/lua/lua_values.cc	(revision 439)
+++ trunk/src/lua/lua_values.cc	(revision 440)
@@ -65,9 +65,4 @@
 }
 
-void nv::lua::detail::push_string  ( lua_State *L, const std::string& s )
-{
-	lua_pushlstring( L, s.c_str(), s.size() );
-}
-
 void nv::lua::detail::push_cstring ( lua_State *L, const char* s )
 {
@@ -109,11 +104,4 @@
 {
 	return lua_toboolean( L, index ) != 0;
-}
-
-std::string nv::lua::detail::to_string  ( lua_State *L, int index )
-{
-	size_t length = 0;
-	const char* result = lua_tolstring( L, index, &length );
-	return std::string( result, length );
 }
 
@@ -171,7 +159,7 @@
 }
 
-std::string nv::lua::detail::to_string  ( lua_State *L, int index, const std::string& def )
+nv::string_view nv::lua::detail::to_string_view( lua_State *L, int index, string_view def )
 {
-	return ( lua_type( L, index ) == LUA_TSTRING ? lua_tostring( L, index ) : def );
+	return ( lua_type( L, index ) == LUA_TSTRING ? nlua_tostringview( L, index ) : def );
 }
 
Index: trunk/src/sdl/sdl_window.cc
===================================================================
--- trunk/src/sdl/sdl_window.cc	(revision 439)
+++ trunk/src/sdl/sdl_window.cc	(revision 440)
@@ -36,6 +36,6 @@
 	uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
 	if (fullscreen) flags |= SDL_WINDOW_FULLSCREEN;
-	m_title  = "Nova Engine";
-	m_handle = SDL_CreateWindow( m_title.c_str(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
+	m_title.assign( "Nova Engine" );
+	m_handle = SDL_CreateWindow( m_title.data(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
 		width, height, flags );
 	if ( m_handle == 0 )
@@ -77,8 +77,8 @@
 }
 
-void sdl::window::set_title( const std::string& title )
+void sdl::window::set_title( const string_view& title )
 {
-	SDL_SetWindowTitle( static_cast<SDL_Window*>( m_handle ), title.c_str() );
-	m_title = title;
+	SDL_SetWindowTitle( static_cast<SDL_Window*>( m_handle ), title.data() );
+	m_title.assign( title );
 }
 
Index: trunk/src/stl/assert.cc
===================================================================
--- trunk/src/stl/assert.cc	(revision 439)
+++ trunk/src/stl/assert.cc	(revision 440)
@@ -10,5 +10,5 @@
 extern "C" {
 #if NV_COMPILER == NV_MSVC
-	_ACRTIMP NV_NORETURN void __cdecl exit( _In_ int _Code );
+	NV_NORETURN void __cdecl exit( int _Code );
 #else
 	void exit( int status_code ) NV_NORETURN;
