After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 118210 - allow to set intial hash table size
allow to set intial hash table size
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: ghashtable
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2003-07-24 17:00 UTC by alef-zero
Modified: 2018-05-24 10:28 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Adds g_hash_table_set_min_capacity() (4.10 KB, patch)
2007-11-27 08:29 UTC, Kyle Ambroff
none Details | Review

Description alef-zero 2003-07-24 17:00:32 UTC
there is no currenty ability to set initial size of hash_table.
despite someone want to create big hashtable and know that (eg. 1000000
items) hash always starts from 11 items and has to do unnecessary
reallocations.
Comment 1 Owen Taylor 2003-08-05 20:19:38 UTC
Hmm, it would have to be somethign like:

 g_hash_table_set_min_buckets()

since otherwise, it would be unclear when you should
start resizing the hash table smaller again when
you removed items.
Comment 2 Kyle Ambroff 2007-11-27 08:29:43 UTC
Created attachment 99699 [details] [review]
Adds g_hash_table_set_min_capacity()

Patch adds getter and setter for hash_table->min_capacity, which is used as lower bounds for g_hash_table_resize().
Comment 3 GNOME Infrastructure Team 2018-05-24 10:28:31 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/12.