docs: Mention g_string_ref_new() in g_strdup()

Instead of duplicating strings, using the reference counted version may
be more efficient.

https://bugzilla.gnome.org/show_bug.cgi?id=622721
This commit is contained in:
Emmanuele Bassi
2015-02-07 12:21:55 +00:00
parent f2cd87afa3
commit e0d5ae394d

View File

@@ -342,6 +342,9 @@ get_C_locale (void)
* The returned string should be freed with g_free() * The returned string should be freed with g_free()
* when no longer needed. * when no longer needed.
* *
* You may want to use g_string_ref_new() in order to use
* reference counted strings, instead of duplicating them.
*
* Returns: a newly-allocated copy of @str * Returns: a newly-allocated copy of @str
*/ */
gchar* gchar*