Module: sip-router Branch: master Commit: ee7dcac57501cd0563c69ae967ba785cec035062 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ee7dcac5...
Author: Elena-Ramona Modroiu ramona@asipto.com Committer: Elena-Ramona Modroiu ramona@asipto.com Date: Mon Aug 19 16:48:01 2013 +0200
htable: lifted limit for max number of slots to 2^31
- there can be systems with large amount of memory - clarification in docs about the case when the value is out of exected range
---
modules/htable/README | 4 ++-- modules/htable/doc/htable_admin.xml | 4 ++-- modules/htable/ht_api.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/htable/README b/modules/htable/README index 3324807..fe0c37f 100644 --- a/modules/htable/README +++ b/modules/htable/README @@ -299,8 +299,8 @@ if(is_present_hf("Authorization")) * size - number specifying the size of hash table. Larger value means less collisions. The number of entries (aka slots or buckets) in the table is 2^size. The possible range for this value is from 2 to - 14, smaller or larger values will be increased or decreased - respectivly. + 31, smaller or larger values will be increased to 3 (8 slots) or + decreased to 14 (16384 slots). * autoexpire -time in seconds to delete an item from hash table if no update was done to it. If is missing or set to 0, the items won't expire. diff --git a/modules/htable/doc/htable_admin.xml b/modules/htable/doc/htable_admin.xml index c38e555..3331bff 100644 --- a/modules/htable/doc/htable_admin.xml +++ b/modules/htable/doc/htable_admin.xml @@ -236,8 +236,8 @@ if(is_present_hf("Authorization")) <emphasis>size</emphasis> - number specifying the size of hash table. Larger value means less collisions. The number of entries (aka slots or buckets) in the table is 2^size. The possible range - for this value is from 2 to 14, smaller or larger values will be - increased or decreased respectivly. + for this value is from 2 to 31, smaller or larger values will be + increased to 3 (8 slots) or decreased to 14 (16384 slots). </para> </listitem> <listitem> diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c index 84eb2e0..3dd96cc 100644 --- a/modules/htable/ht_api.c +++ b/modules/htable/ht_api.c @@ -248,7 +248,7 @@ int ht_add_table(str *name, int autoexp, str *dbtable, int size, int dbmode,
if(size<=1) ht->htsize = 8; - else if(size>14) + else if(size>31) ht->htsize = 1<<14; else ht->htsize = 1<<size; ht->htid = htid;