Re: [PATCH 3/9] libports: reduce malloc overhead in _ports_bucket_class_iterate

2014-04-28 Thread Samuel Thibault
Justus Winter, le Mon 28 Apr 2014 12:19:58 +0200, a écrit : > ports_class_iterate. For this change might make ports_class_iterate > less efficient memory-wise if the number of ports belonging to the > class is low with respect to the number of ports in the bucket. I'd say reallocing the array to

[PATCH 3/9] libports: reduce malloc overhead in _ports_bucket_class_iterate

2014-04-28 Thread Justus Winter
_ports_bucket_class_iterate creates a snapshot of the buckets hash table. This is done so that the lock protecting the hash table can be released while we iterate over the snapshot. Formerly, a linked list was used to store the snapshot. As the maximal number of items is known, using an array is