diff --git a/doc/Makefile.in b/doc/Makefile.in index aa761c6..397f883 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -17,6 +17,7 @@ OBJECTS=ck_ht_count \ ck_ht_put_spmc \ ck_ht_remove_spmc \ ck_ht_reset_spmc \ + ck_ht_reset_size_spmc \ ck_ht_set_spmc \ ck_ht_entry_empty \ ck_ht_entry_key \ diff --git a/doc/ck_ht_count b/doc/ck_ht_count index d8c7e32..92d2089 100644 --- a/doc/ck_ht_count +++ b/doc/ck_ht_count @@ -58,7 +58,8 @@ has not been initialized. .Xr ck_ht_get_spmc 3 , .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_size_spmc 3 , +.Xr ck_ht_reset_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_destroy b/doc/ck_ht_destroy index 13b110c..a509a09 100644 --- a/doc/ck_ht_destroy +++ b/doc/ck_ht_destroy @@ -68,6 +68,7 @@ This function is guaranteed not to fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_entry_empty b/doc/ck_ht_entry_empty index 93b621f..385be4b 100644 --- a/doc/ck_ht_entry_empty +++ b/doc/ck_ht_entry_empty @@ -72,7 +72,8 @@ has not been initialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , .Xr ck_ht_entry_key 3 , diff --git a/doc/ck_ht_entry_key b/doc/ck_ht_entry_key index 88956db..651477a 100644 --- a/doc/ck_ht_entry_key +++ b/doc/ck_ht_entry_key @@ -70,7 +70,8 @@ has not been initialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_entry_key_direct b/doc/ck_ht_entry_key_direct index b00e5b5..a5ed16f 100644 --- a/doc/ck_ht_entry_key_direct +++ b/doc/ck_ht_entry_key_direct @@ -73,7 +73,8 @@ has not been initialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_entry_key_length b/doc/ck_ht_entry_key_length index 2635ff0..c0e1326 100644 --- a/doc/ck_ht_entry_key_length +++ b/doc/ck_ht_entry_key_length @@ -70,7 +70,8 @@ has not been initialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_entry_key_set b/doc/ck_ht_entry_key_set index 3f87455..0dd4628 100644 --- a/doc/ck_ht_entry_key_set +++ b/doc/ck_ht_entry_key_set @@ -75,7 +75,8 @@ This function will never fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set_direct 3 , .Xr ck_ht_entry_key 3 , diff --git a/doc/ck_ht_entry_key_set_direct b/doc/ck_ht_entry_key_set_direct index 03e2a4e..9d57444 100644 --- a/doc/ck_ht_entry_key_set_direct +++ b/doc/ck_ht_entry_key_set_direct @@ -70,7 +70,8 @@ This function will never fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key 3 , diff --git a/doc/ck_ht_entry_set b/doc/ck_ht_entry_set index ec99a22..b5c2f80 100644 --- a/doc/ck_ht_entry_set +++ b/doc/ck_ht_entry_set @@ -77,7 +77,8 @@ This function will never fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_set_direct 3 , .Xr ck_ht_entry_key 3 , diff --git a/doc/ck_ht_entry_set_direct b/doc/ck_ht_entry_set_direct index 3e32e6b..c446044 100644 --- a/doc/ck_ht_entry_set_direct +++ b/doc/ck_ht_entry_set_direct @@ -76,7 +76,8 @@ This function will never fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key 3 , .Xr ck_ht_entry_key_length 3 , diff --git a/doc/ck_ht_entry_value b/doc/ck_ht_entry_value index 9209937..c0ca3ef 100644 --- a/doc/ck_ht_entry_value +++ b/doc/ck_ht_entry_value @@ -70,7 +70,8 @@ has not been initialized or if the key is empty. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_entry_value_direct b/doc/ck_ht_entry_value_direct index c0580b7..9cdf022 100644 --- a/doc/ck_ht_entry_value_direct +++ b/doc/ck_ht_entry_value_direct @@ -71,7 +71,8 @@ has not been initialized or if the key is empty. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_get_spmc b/doc/ck_ht_get_spmc index ea5d0a3..c46f0c1 100644 --- a/doc/ck_ht_get_spmc +++ b/doc/ck_ht_get_spmc @@ -158,6 +158,7 @@ was not found in the hash table. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_grow_spmc b/doc/ck_ht_grow_spmc index 9dbf5e8..563fb92 100644 --- a/doc/ck_ht_grow_spmc +++ b/doc/ck_ht_grow_spmc @@ -79,6 +79,7 @@ if there are internal memory allocation failures. .Xr ck_ht_get_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_hash b/doc/ck_ht_hash index d7a1dc3..fe037e9 100644 --- a/doc/ck_ht_hash +++ b/doc/ck_ht_hash @@ -71,6 +71,7 @@ is uninitialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_hash_direct b/doc/ck_ht_hash_direct index 17afb9f..4ad5364 100644 --- a/doc/ck_ht_hash_direct +++ b/doc/ck_ht_hash_direct @@ -71,6 +71,7 @@ is uninitialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_init b/doc/ck_ht_init index 5304017..947ca97 100644 --- a/doc/ck_ht_init +++ b/doc/ck_ht_init @@ -164,6 +164,7 @@ object. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_iterator_init b/doc/ck_ht_iterator_init index e934880..6a2462b 100644 --- a/doc/ck_ht_iterator_init +++ b/doc/ck_ht_iterator_init @@ -71,7 +71,7 @@ This function will not fail. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_next b/doc/ck_ht_next index 30059dd..db298ac 100644 --- a/doc/ck_ht_next +++ b/doc/ck_ht_next @@ -89,7 +89,8 @@ are uninitialized. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_count 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 , diff --git a/doc/ck_ht_put_spmc b/doc/ck_ht_put_spmc index 0b5f7cf..38d78c9 100644 --- a/doc/ck_ht_put_spmc +++ b/doc/ck_ht_put_spmc @@ -127,6 +127,7 @@ was already present in the hash table. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_remove_spmc b/doc/ck_ht_remove_spmc index 7878799..f8ba2c6 100644 --- a/doc/ck_ht_remove_spmc +++ b/doc/ck_ht_remove_spmc @@ -98,6 +98,7 @@ will return .Xr ck_ht_get_spmc 3 , .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_reset_size_spmc b/doc/ck_ht_reset_size_spmc new file mode 100644 index 0000000..49cdc29 --- /dev/null +++ b/doc/ck_ht_reset_size_spmc @@ -0,0 +1,83 @@ +.\" +.\" Copyright 2012-2013 Samy Al Bahra. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" +.Dd May 5, 2013 +.Dt CK_HT_RESET_SPMC 3 +.Sh NAME +.Nm ck_ht_reset_size_spmc +.Nd remove all entries from a hash table and reset size +.Sh LIBRARY +Concurrency Kit (libck, \-lck) +.Sh SYNOPSIS +.In ck_ht.h +.Ft bool +.Fn ck_ht_reset_size_spmc "ck_ht_t *ht" "uint64_t capacity" +.Sh DESCRIPTION +The +.Fn ck_ht_reset_size_spmc +function will remove all key-value pairs stored in the hash +table pointed to by the +.Fa ht +argument and create a new generation of the hash table that +is preallocated for +.Fa capacity +entries. +.Sh RETURN VALUES +If successful, +.Fn ck_ht_reset_size_spmc +will return +.Dv true +and will otherwise return +.Dv false. +This function will only fail if a replacement hash table +could not be allocated internally. +.Sh SEE ALSO +.Xr ck_ht_stat 3 , +.Xr ck_ht_init 3 , +.Xr ck_ht_destroy 3 , +.Xr ck_ht_hash 3 , +.Xr ck_ht_hash_direct 3 , +.Xr ck_ht_set_spmc 3 , +.Xr ck_ht_put_spmc 3 , +.Xr ck_ht_get_spmc 3 , +.Xr ck_ht_grow_spmc 3 , +.Xr ck_ht_remove_spmc 3 , +.Xr ck_ht_count 3 , +.Xr ck_ht_entry_empty 3 , +.Xr ck_ht_entry_key_set 3 , +.Xr ck_ht_entry_key_set_direct 3 , +.Xr ck_ht_entry_key 3 , +.Xr ck_ht_entry_key_length 3 , +.Xr ck_ht_entry_value 3 , +.Xr ck_ht_entry_set 3 , +.Xr ck_ht_entry_set_direct 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_entry_key_direct 3 , +.Xr ck_ht_entry_value_direct 3 , +.Xr ck_ht_iterator_init 3 , +.Xr ck_ht_next 3 +.Pp +Additional information available at http://concurrencykit.org/ diff --git a/doc/ck_ht_reset_spmc b/doc/ck_ht_reset_spmc index 5b3af4c..ae072e0 100644 --- a/doc/ck_ht_reset_spmc +++ b/doc/ck_ht_reset_spmc @@ -62,6 +62,7 @@ could not be allocated internally. .Xr ck_ht_get_spmc 3 , .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_set_spmc b/doc/ck_ht_set_spmc index a466a5c..6bf9180 100644 --- a/doc/ck_ht_set_spmc +++ b/doc/ck_ht_set_spmc @@ -121,6 +121,7 @@ while attempting to grow. .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , .Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_count 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , diff --git a/doc/ck_ht_stat b/doc/ck_ht_stat index 1d1f55d..ab7d29c 100644 --- a/doc/ck_ht_stat +++ b/doc/ck_ht_stat @@ -66,7 +66,8 @@ has not been initialized. .Xr ck_ht_get_spmc 3 , .Xr ck_ht_grow_spmc 3 , .Xr ck_ht_remove_spmc 3 , -.Xr ck_ht_reset 3 , +.Xr ck_ht_reset_spmc 3 , +.Xr ck_ht_reset_size_spmc 3 , .Xr ck_ht_entry_empty 3 , .Xr ck_ht_entry_key_set 3 , .Xr ck_ht_entry_key_set_direct 3 ,