mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
parent
34f03f01c8
commit
cbae555a98
@ -68,13 +68,14 @@
|
|||||||
* given a key the value can be found quickly
|
* given a key the value can be found quickly
|
||||||
*
|
*
|
||||||
* A #GHashTable provides associations between keys and values which is
|
* A #GHashTable provides associations between keys and values which is
|
||||||
* optimized so that given a key, the associated value can be found
|
* optimized so that given a key, the associated value can be found,
|
||||||
* very quickly.
|
* inserted or removed in amortized O(1). All operations going through
|
||||||
|
* each element take O(n) time (list all keys/values, table resize, etc.).
|
||||||
*
|
*
|
||||||
* Note that neither keys nor values are copied when inserted into the
|
* Note that neither keys nor values are copied when inserted into the
|
||||||
* #GHashTable, so they must exist for the lifetime of the #GHashTable.
|
* #GHashTable, so they must exist for the lifetime of the #GHashTable.
|
||||||
* This means that the use of static strings is OK, but temporary
|
* This means that the use of static strings is OK, but temporary
|
||||||
* strings (i.e. those created in buffers and those returned by GTK+
|
* strings (i.e. those created in buffers and those returned by GTK
|
||||||
* widgets) should be copied with g_strdup() before being inserted.
|
* widgets) should be copied with g_strdup() before being inserted.
|
||||||
*
|
*
|
||||||
* If keys or values are dynamically allocated, you must be careful to
|
* If keys or values are dynamically allocated, you must be careful to
|
||||||
|
Loading…
Reference in New Issue
Block a user