stringshare_del optimization.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 28 Oct 2008 12:23:12 +0000 (12:23 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 28 Oct 2008 12:23:12 +0000 (12:23 +0000)
commit23fd5812037e1cb713c4cf136c91f34fc21dbde8
tree5b71a8ba9b622583fb796cf255aaef7334a9bcee
parent6a54af76c7b7e4c651250d582043bc1f4e920615
stringshare_del optimization.

trade off safety by speed, we will always assume str was previously
shared, like evas_stringshare_del() did and we can know with zero-cost
the number of references and can avoid strlen() too.

When references drop to zero we still have to do the hash, access the
bucket and then lookup the Red-Black tree, then walk the list of
nodes, but avoiding so would use more memory, unacceptable at this
point.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@37268 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/lib/eina_stringshare.c