forked from enlightenment/efl
eina: disable randomisation for Eina_Hash superfast.
SVN revision: 83698
This commit is contained in:
parent
1cb8c3c006
commit
d9cafa2052
|
@ -1325,7 +1325,7 @@ eina_hash_iterator_tuple_new(const Eina_Hash *hash)
|
||||||
EAPI int
|
EAPI int
|
||||||
eina_hash_superfast(const char *key, int len)
|
eina_hash_superfast(const char *key, int len)
|
||||||
{
|
{
|
||||||
int hash = len ^ eina_seed, tmp;
|
int hash = len, tmp;
|
||||||
int rem;
|
int rem;
|
||||||
|
|
||||||
rem = len & 3;
|
rem = len & 3;
|
||||||
|
|
|
@ -226,11 +226,12 @@
|
||||||
* @li @c string_small - slower hash function but less collisions - 32 buckets
|
* @li @c string_small - slower hash function but less collisions - 32 buckets
|
||||||
* (lower memory consumption)
|
* (lower memory consumption)
|
||||||
* @li @c string_superfast - slower hash function but less collisions - 256 buckets
|
* @li @c string_superfast - slower hash function but less collisions - 256 buckets
|
||||||
* (higher memory consumption)
|
* (higher memory consumption) - not randomized, avoid it on public remote interface.
|
||||||
*
|
*
|
||||||
* Basically for a very small number of keys (10 or less), @c djb2 should be
|
* Basically for a very small number of keys (10 or less), @c djb2 should be
|
||||||
* used, or @c string_small if you have a restriction on memory usage. And for a
|
* used, or @c string_small if you have a restriction on memory usage. And for a
|
||||||
* higher number of keys, @c string_superfast should be always preferred.
|
* higher number of keys, @c string_superfast should be preferred if not used on a
|
||||||
|
* public remote interface.
|
||||||
*
|
*
|
||||||
* If just stringshared keys are being added, use @ref
|
* If just stringshared keys are being added, use @ref
|
||||||
* eina_hash_stringshared_new. If a lot of keys will be added to the hash table
|
* eina_hash_stringshared_new. If a lot of keys will be added to the hash table
|
||||||
|
@ -395,6 +396,9 @@ EAPI Eina_Hash *eina_hash_string_djb2_new(Eina_Free_Cb data_free_cb);
|
||||||
* then be looked up with pointers other than the original key pointer
|
* then be looked up with pointers other than the original key pointer
|
||||||
* that was used to add values. On failure, this function returns
|
* that was used to add values. On failure, this function returns
|
||||||
* @c NULL.
|
* @c NULL.
|
||||||
|
*
|
||||||
|
* NOTE: don't use this kind of hash when their is a possibility to remotely
|
||||||
|
* request and push data in it. This hash is subject to denial of service.
|
||||||
*/
|
*/
|
||||||
EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
|
EAPI Eina_Hash *eina_hash_string_superfast_new(Eina_Free_Cb data_free_cb);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue