Commit Graph

5 Commits

Author SHA1 Message Date
Tom Hacohen 3675a5f02b Eina: Add Eina_UStringshare and Eina_Binshare.
Also modified Eina_Stringshare to share most of the code with the two above.
Added Magics for Eina_UStrbuf as well as for UStringshare/Binshare.

SVN revision: 50533
2010-07-27 08:55:23 +00:00
Mike Blumenkrantz c146935917 +eina_stringshare_replace_length to replace a stringshared string with a given length of another string
SVN revision: 50320
2010-07-18 07:39:21 +00:00
Gustavo Sverzut Barbieri 9839906150 stringshare: optimization suggested by rasterman, docs.
SVN revision: 47193
2010-03-14 01:06:52 +00:00
Carsten Haitzler 1c00a019e9 new -> news. people with g++ using eina in their c++ stuff will be most
un-amused by the use of a variable called "new".



SVN revision: 39905
2009-04-09 05:55:51 +00:00
Gustavo Sverzut Barbieri 2e9a9a9700 eina_stringshare_replace() gets in!
I was replicating this code in many places, it should go into eina itself.

It's the right way to change strings that you don't know are
stringshared before, since it will first add a reference and then
remove, making it impossible to have references to go 0 and string
being released before adding new references, fixing the following
possible problem:

   x = eina_stringshare_add("x");
   replace(x, x);

   then:
   incorrect_replace(const char **b, const char *a) {
      eina_stringshare_del(*b); /* reference gets to 0 */
      eina_stringshare_add(a); /* BUG!!! */
      *b = a;
   }




SVN revision: 39903
2009-04-08 18:25:02 +00:00