X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fdoc%2Fhashtable.txt;h=2d0375a902d811dcf633d194834ca5f28472aaea;hb=25541ea3bb96e9f143f0e23f8ac5b432f2f6f47a;hp=35dbe28a02a851ea74a40cc8c80f28f7958006a2;hpb=c792c5e657737a794893ae3505fba633b93e44b7;p=libucw.git diff --git a/ucw/doc/hashtable.txt b/ucw/doc/hashtable.txt index 35dbe28a..2d0375a9 100644 --- a/ucw/doc/hashtable.txt +++ b/ucw/doc/hashtable.txt @@ -3,7 +3,7 @@ Hash tables A hash table is very universal data structure. It does most of it's operations in O(1) average time. The library contains a header to -generate hash tables suiting to your needs. +generate hash tables suiting your needs. They are <>. @@ -80,9 +80,15 @@ to customize the behaviour. The macros are: - `HASH_GIVE_ALLOC` -- you need to provide `void \*HASH_PREFIX(alloc)(uns size` and `void HASH_PREFIX(free)(void \*)` to allocate and deallocate the nodes. Default uses - <> and <> or <>, depending on <> and - <> switches. + <> and <>, <> or <>, depending on + <>, <>, + <> and <> switches. +- <> -- you need to provide `void + \*HASH_PREFIX(table_alloc)(uns size` and `void HASH_PREFIX(table_free)(void \*)` + to allocate and deallocate the table itself. Default uses + <> and <> or the functions + from `HASH_GIVE_ALLOC` depending on <> switch. [[params]] Optional parameters @@ -106,14 +112,27 @@ You can customize the hash table a little more by these macros: [[auto_pool]] - `HASH_AUTO_POOL` -- like above, but it creates it's own mempool. Define it to the block size of the pool. +[[use_eltpool]] +- `HASH_USE_ELTPOOL` -- tells to use <> to + allocate the nodes. You should define it to the name of eltpool + variable to be used for this purpose. +[[auto_eltpool]] +- `HASH_AUTO_ELTPOOL` -- like above, but it creates it's own mempool. + Define it to the number of preallocated nodes in each chunk of memory. - `HASH_ZERO_FILL` -- initialize new nodes to all zeroes. +[[table-alloc]] - `HASH_TABLE_ALLOC` -- allocate the table the same way as nodes. If not provided, <> is used. +- `HASH_TABLE_GROWING` -- never decrease the size of allocated table of nodes. [[table_dynamic]] - `HASH_TABLE_DYNAMIC` -- By default, only one global hash table is used. With this macro defined, all functions gain new first parameter of type `HASH_PREFIX(table) *` to allow them work with multiple hash tables. +- `HASH_TABLE_VARS` -- extra variables to be defined at head + of `HASH_PREFIX(table) *` structure. It can be useful in combination + with <> to access per-table custom variables + from macros or function switches before you include the generator. [[wants]] Functionality switches