Stringshare doc additions.

SVN revision: 68271
This commit is contained in:
Jonas M. Gastal 2012-02-22 13:35:01 +00:00
parent b985aae805
commit 48b90afbbf
1 changed files with 14 additions and 0 deletions

View File

@ -126,6 +126,20 @@
* string creation/destruction speed, reduces memory use and decreases
* memory fragmentation, so a win all-around.
*
* Using eina stringshares usually boils down to:
* @code
* const char *str = eina_stringshare_add("My string");
* ...
* //Use str
* ...
* eina_stringshare_del(str);
* @endcode
* @note It's very important to note that string shares are @b @c const,
* changing them will result in undefined behavior.
* @note eina_stringshare_del() @b doesn't guarantee the string share will be
* freed, it releases a reference to it, but if other references to it still
* exist the string share will live until those are released.
*
* The following diagram gives an idea of what happens as you create strings
* with eina_stringshare_add():
*