Browse code

htable: docs - more details about size attribute for htable

Daniel-Constantin Mierla authored on 01/05/2020 15:26:39
Showing 1 changed files
... ...
@@ -341,11 +341,17 @@ $ kamcmd htable.dump htable
341 341
 		</listitem>
342 342
 		<listitem>
343 343
 		<para>
344
-			<emphasis>size</emphasis> - number specifying the size of hash
345
-			table.  Larger value means less collisions. The number of entries
346
-			(aka slots or buckets) in the table is 2^size. The possible range
344
+			<emphasis>size</emphasis> - number to control how many slots
345
+			(buckets) to create for the hash table. Larger value means more
346
+			slots with higher probability for less collisions. The actual number
347
+			slots (or buckets) created for the table is 2^size. The possible range
347 348
 			for this value is from 2 to 31, smaller or larger values will be
348
-			increased to 3 (8 slots) or decreased to 14 (16384 slots).
349
+			increased to 3 (8 slots) or decreased to 14 (16384 slots). Note
350
+			that each slot can store more than one item, when there are
351
+			collisions of hash ids computed for keys. The items in the same
352
+			slot are stored in a linked list. In other words, the size is not
353
+			setting a limit of how many items can be stored in a hash table, as
354
+			long as there is enough free shared memory, new items can be added.
349 355
 		</para>
350 356
 		</listitem>
351 357
 		<listitem>