Switch from ecore_strings to eina_stringshare.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 15 Oct 2008 15:00:38 +0000 (15:00 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 15 Oct 2008 15:00:38 +0000 (15:00 +0000)
This could change E17 stringshare behaviour. Would be a good idea, to
do a session dump, benchmark and profile again.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/e_dbus@36678 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/hal.c
src/bin/nm.c
src/lib/dbus/e_dbus.c
src/lib/hal/E_Hal.h
src/lib/hal/e_hal_device.c
src/lib/notification/marshal.c

index 215951c..238e423 100644 (file)
@@ -776,7 +776,7 @@ main(int argc, char **argv)
 #endif
 
   ecore_init();
-  ecore_string_init();
+  eina_stringshare_init();
   e_dbus_init();
 
 #if EWL_GUI
@@ -824,7 +824,7 @@ main(int argc, char **argv)
   ecore_list_destroy(volumes);
   e_dbus_connection_close(conn);
   e_dbus_shutdown();
-  ecore_string_shutdown();
+  eina_stringshare_shutdown();
   ecore_shutdown();
   return 1;
 }
index a917ab8..5fd488b 100644 (file)
@@ -265,7 +265,7 @@ main(int argc, char **argv)
 {
     NM_Manager *app;
     ecore_init();
-    ecore_string_init();
+    eina_stringshare_init();
     e_dbus_init();
    
     app = calloc(1, sizeof(NM_Manager));
@@ -284,7 +284,7 @@ main(int argc, char **argv)
     e_nm_free(app->ctx);
     free(app);
     e_dbus_shutdown();
-    ecore_string_shutdown();
+    eina_stringshare_shutdown();
     ecore_shutdown();
     return 0;
 }
index e83c6ad..4d9b579 100644 (file)
@@ -586,8 +586,8 @@ e_dbus_init(void)
 {
   if (++init != 1) return init;
 
+  eina_init();
   E_DBUS_EVENT_SIGNAL = ecore_event_type_new();
-  ecore_string_init();
   e_dbus_object_init();
   return init;
 }
@@ -600,6 +600,6 @@ e_dbus_shutdown(void)
 {
   if (--init) return init;
   e_dbus_object_shutdown();
-  ecore_string_shutdown();
+  eina_shutdown();
   return init;
 }
index 6feb79a..62d5e3b 100644 (file)
@@ -2,6 +2,7 @@
 #define E_HAL_H
 #include <E_DBus.h>
 #include <Ecore_Data.h>
+#include <eina_stringshare.h>
 
 #ifdef EAPI
 #undef EAPI
index 68a9dc1..54cf4d9 100644 (file)
@@ -89,7 +89,7 @@ unmarshal_device_get_all_properties(DBusMessage *msg, DBusError *err)
   }
 
   ret->properties = ecore_hash_new(ecore_str_hash, ecore_str_compare);
-  ecore_hash_free_key_cb_set(ret->properties, ECORE_FREE_CB(ecore_string_release));
+  ecore_hash_free_key_cb_set(ret->properties, ECORE_FREE_CB(eina_stringshare_del));
   ecore_hash_free_value_cb_set(ret->properties, ECORE_FREE_CB(e_hal_property_free));
 
 
@@ -145,7 +145,7 @@ unmarshal_device_get_all_properties(DBusMessage *msg, DBusError *err)
         printf("Error: unexpected property type (%s): %c\n", name, dbus_message_iter_get_arg_type(&v_iter));
         break;
     }
-    ecore_hash_set(ret->properties, (void *)ecore_string_instance(name), prop);
+    ecore_hash_set(ret->properties, (void *)eina_stringshare_add(name), prop);
 
     dbus_message_iter_next(&a_iter);
   }
index a14ef99..9a0a8e2 100644 (file)
@@ -102,14 +102,14 @@ e_notify_unmarshal_string_array_as_list(DBusMessageIter *iter, DBusError *err)
   if (!ret) return NULL;
 
   strings = ecore_list_new();
-  ecore_list_free_cb_set(strings, ECORE_FREE_CB(free)); //XXX use ecore_string_release?
+  ecore_list_free_cb_set(strings, ECORE_FREE_CB(free)); //XXX use eina_stringshare_release?
 
   dbus_message_iter_recurse(iter, &arr);
   while(dbus_message_iter_has_next(&arr))
   {
     const char *str;
     dbus_message_iter_get_basic(&arr, &str);
-    ecore_list_append(strings, strdup(str)); //XXX use ecore_string_instance?
+    ecore_list_append(strings, strdup(str)); //XXX use eina_stringshare_instance?
     dbus_message_iter_next(&arr);
   }
   return strings;