From a91052d12730dbc0e5fd007b3c89049ea6f2bf7f Mon Sep 17 00:00:00 2001 From: Erik Nyquist Date: Thu, 4 Jan 2024 18:11:38 -0800 Subject: [PATCH] Minor docs updates --- Doxyfile | 2 +- docs/annotated.html | 2 +- docs/classes.html | 2 +- docs/files.html | 2 +- docs/functions.html | 2 +- docs/functions_vars.html | 2 +- docs/globals.html | 5 +- docs/globals_defs.html | 2 +- docs/globals_func.html | 2 +- docs/globals_type.html | 5 +- docs/hashtable__api_8h.html | 35 +-- docs/hashtable__api_8h_source.html | 273 ++++++++++--------- docs/index.html | 7 +- docs/performance_graph.png | Bin 156003 -> 197515 bytes docs/search/all_4.js | 3 +- docs/search/all_5.js | 2 +- docs/search/classes_0.js | 4 +- docs/search/defines_0.js | 4 +- docs/search/files_0.js | 2 +- docs/search/functions_0.js | 22 +- docs/search/pages_0.js | 2 +- docs/search/typedefs_0.js | 3 +- docs/search/variables_0.js | 2 +- docs/search/variables_1.js | 2 +- docs/search/variables_2.js | 2 +- docs/search/variables_3.js | 2 +- docs/search/variables_4.js | 2 +- docs/search/variables_5.js | 2 +- docs/structhashtable__config__t-members.html | 2 +- docs/structhashtable__config__t.html | 2 +- docs/structhashtable__t-members.html | 2 +- docs/structhashtable__t.html | 2 +- extras/performance_graph.png | Bin 156003 -> 197515 bytes hashtable_api.h | 3 + perf_test/perf_test2.c | 8 +- perf_test/process_output.py | 2 +- 36 files changed, 215 insertions(+), 201 deletions(-) diff --git a/Doxyfile b/Doxyfile index 53d82eb..4b5bd68 100644 --- a/Doxyfile +++ b/Doxyfile @@ -53,7 +53,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "A lightweight separate-chaining hashtable in C" +PROJECT_BRIEF = "A lightweight separate-chaining arena-backed hashtable in C" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 diff --git a/docs/annotated.html b/docs/annotated.html index c7c0e90..3df78fd 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
diff --git a/docs/classes.html b/docs/classes.html index b6eab47..3705d5c 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
diff --git a/docs/files.html b/docs/files.html index fad95b7..b6a9c39 100644 --- a/docs/files.html +++ b/docs/files.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
diff --git a/docs/functions.html b/docs/functions.html index e9560e9..d530eea 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
diff --git a/docs/functions_vars.html b/docs/functions_vars.html index 471c5f5..0191760 100644 --- a/docs/functions_vars.html +++ b/docs/functions_vars.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
diff --git a/docs/globals.html b/docs/globals.html index 45cd799..7491b24 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -25,7 +25,7 @@
hashtable v0.1.1
-
A lightweight separate-chaining hashtable in C
+
A lightweight separate-chaining arena-backed hashtable in C
@@ -107,6 +107,9 @@
  • hashtable_retrieve() : hashtable_api.h
  • +
  • hashtable_size_t +: hashtable_api.h +
  • diff --git a/docs/globals_defs.html b/docs/globals_defs.html index 153f1d3..f6ba2bf 100644 --- a/docs/globals_defs.html +++ b/docs/globals_defs.html @@ -25,7 +25,7 @@
    hashtable v0.1.1
    -
    A lightweight separate-chaining hashtable in C
    +
    A lightweight separate-chaining arena-backed hashtable in C
    diff --git a/docs/globals_func.html b/docs/globals_func.html index 429f4c0..45c81ab 100644 --- a/docs/globals_func.html +++ b/docs/globals_func.html @@ -25,7 +25,7 @@
    hashtable v0.1.1
    -
    A lightweight separate-chaining hashtable in C
    +
    A lightweight separate-chaining arena-backed hashtable in C
    diff --git a/docs/globals_type.html b/docs/globals_type.html index afc3d3a..c8083c1 100644 --- a/docs/globals_type.html +++ b/docs/globals_type.html @@ -25,7 +25,7 @@
    hashtable v0.1.1
    -
    A lightweight separate-chaining hashtable in C
    +
    A lightweight separate-chaining arena-backed hashtable in C
    @@ -68,6 +68,9 @@
  • hashtable_hashfunc_t : hashtable_api.h
  • +
  • hashtable_size_t +: hashtable_api.h +
  • diff --git a/docs/hashtable__api_8h.html b/docs/hashtable__api_8h.html index e10f786..324062f 100644 --- a/docs/hashtable__api_8h.html +++ b/docs/hashtable__api_8h.html @@ -25,7 +25,7 @@
    hashtable v0.1.1
    -
    A lightweight separate-chaining hashtable in C
    +
    A lightweight separate-chaining arena-backed hashtable in C
    @@ -102,26 +102,27 @@

    Typedefs

    -typedef size_t hashtable_size_t +typedef size_t hashtable_size_t + Defines the type used to represent the size of keys and values stored in the hashtable.
      -typedef uint32_t(* hashtable_hashfunc_t) (const char *data, const hashtable_size_t size) +typedef uint32_t(* hashtable_hashfunc_t) (const char *data, const hashtable_size_t size)   - + - + - + - + - + @@ -167,7 +168,7 @@

    Functions

    int hashtable_create (hashtable_t *table, const hashtable_config_t *config, void *buffer, size_t buffer_size)
     
    int hashtable_insert (hashtable_t *table, const char *key, const hashtable_size_t key_size, const char *value, const hashtable_size_t value_size)
    int hashtable_insert (hashtable_t *table, const char *key, const hashtable_size_t key_size, const char *value, const hashtable_size_t value_size)
     
    int hashtable_remove (hashtable_t *table, const char *key, const hashtable_size_t key_size)
    int hashtable_remove (hashtable_t *table, const char *key, const hashtable_size_t key_size)
     
    int hashtable_retrieve (hashtable_t *table, const char *key, const hashtable_size_t key_size, char **value, hashtable_size_t *value_size)
    int hashtable_retrieve (hashtable_t *table, const char *key, const hashtable_size_t key_size, char **value, hashtable_size_t *value_size)
     
    int hashtable_has_key (hashtable_t *table, const char *key, const hashtable_size_t key_size)
    int hashtable_has_key (hashtable_t *table, const char *key, const hashtable_size_t key_size)
     
    int hashtable_bytes_remaining (hashtable_t *table, size_t *bytes_remaining)
     
    int hashtable_next_item (hashtable_t *table, char **key, hashtable_size_t *key_size, char **value, hashtable_size_t *value_size)
    int hashtable_next_item (hashtable_t *table, char **key, hashtable_size_t *key_size, char **value, hashtable_size_t *value_size)
     
    int hashtable_reset_cursor (hashtable_t *table)
     
    - +
    typedef uint32_t(* hashtable_hashfunc_t) (const char *data, const hashtable_size_t size)typedef uint32_t(* hashtable_hashfunc_t) (const char *data, const hashtable_size_t size)
    @@ -376,7 +377,7 @@

    - const hashtable_size_t  + const hashtable_size_t  key_size  @@ -420,7 +421,7 @@

    - const hashtable_size_t  + const hashtable_size_t  key_size, @@ -432,7 +433,7 @@

    - const hashtable_size_t  + const hashtable_size_t  value_size  @@ -478,7 +479,7 @@

    - hashtable_size_t *  + hashtable_size_tkey_size, @@ -490,7 +491,7 @@

    - hashtable_size_t *  + hashtable_size_tvalue_size  @@ -536,7 +537,7 @@

    - const hashtable_size_t  + const hashtable_size_t  key_size  @@ -606,7 +607,7 @@

    - const hashtable_size_t  + const hashtable_size_t  key_size, @@ -618,7 +619,7 @@

    - hashtable_size_t *  + hashtable_size_tvalue_size  diff --git a/docs/hashtable__api_8h_source.html b/docs/hashtable__api_8h_source.html index 6063edf..4f5af0d 100644 --- a/docs/hashtable__api_8h_source.html +++ b/docs/hashtable__api_8h_source.html @@ -25,7 +25,7 @@
    hashtable v0.1.1
    -
    A lightweight separate-chaining hashtable in C
    +
    A lightweight separate-chaining arena-backed hashtable in C
    @@ -83,132 +83,132 @@
    123 #endif // if !defined..
    124 
    125 
    -
    126 #if defined(HASHTABLE_SIZE_T_UINT16)
    -
    127 typedef uint16_t hashtable_size_t;
    -
    128 #elif defined(HASHTABLE_SIZE_T_UINT32)
    -
    129 typedef uint32_t hashtable_size_t;
    -
    130 #elif defined(HASHTABLE_SIZE_T_SYS)
    -
    131 typedef size_t hashtable_size_t;
    -
    132 #else
    -
    133 #error("HASHTABLE_SIZE_T option not defined")
    -
    134 #endif // if defined....
    -
    135 
    -
    136 
    -
    140 #define HASHTABLE_MIN_ARRAY_COUNT (10u)
    -
    141 
    -
    142 
    -
    149 #define HASHTABLE_MIN_BUFFER_SIZE(array_count) \
    -
    150  (sizeof(_keyval_pair_table_data_t) + sizeof(_keyval_pair_list_table_t) + \
    -
    151  ((array_count) * sizeof(_keyval_pair_list_t)) + \
    -
    152  sizeof(_keyval_pair_data_block_t))
    -
    153 
    -
    154 
    -
    163 typedef uint32_t (*hashtable_hashfunc_t)(const char *data, const hashtable_size_t size);
    -
    164 
    -
    165 
    -
    169 typedef struct
    -
    170 {
    - -
    172  uint32_t array_count;
    - -
    174 
    -
    175 
    -
    179 typedef struct
    -
    180 {
    - -
    182  uint32_t entry_count;
    -
    183  size_t data_size;
    -
    184  void *table_data;
    -
    185 } hashtable_t;
    -
    186 
    -
    187 
    - -
    202  void *buffer, size_t buffer_size);
    -
    203 
    -
    204 
    -
    219 int hashtable_insert(hashtable_t *table, const char *key, const hashtable_size_t key_size,
    -
    220  const char *value, const hashtable_size_t value_size);
    -
    221 
    -
    222 
    -
    234 int hashtable_remove(hashtable_t *table, const char *key, const hashtable_size_t key_size);
    -
    235 
    -
    236 
    -
    249 int hashtable_retrieve(hashtable_t *table, const char *key, const hashtable_size_t key_size,
    -
    250  char **value, hashtable_size_t *value_size);
    -
    251 
    -
    252 
    -
    263 int hashtable_has_key(hashtable_t *table, const char *key, const hashtable_size_t key_size);
    -
    264 
    -
    265 
    -
    275 int hashtable_bytes_remaining(hashtable_t *table, size_t *bytes_remaining);
    -
    276 
    -
    277 
    -
    294 int hashtable_next_item(hashtable_t *table, char **key, hashtable_size_t *key_size,
    -
    295  char **value, hashtable_size_t *value_size);
    -
    296 
    -
    297 
    - -
    309 
    -
    310 
    - -
    320 
    -
    321 
    -
    332 int hashtable_default_config(hashtable_config_t *config, size_t buffer_size);
    -
    333 
    -
    334 
    - -
    344 
    -
    345 
    -
    350 #ifdef HASHTABLE_PACKED_STRUCT
    -
    351 #define _HASHTABLE_PACKED __attribute__((packed))
    -
    352 #else
    -
    353 #define _HASHTABLE_PACKED
    -
    354 #endif // HASHTABLE_PACKED_STRUCT
    -
    355 
    -
    356 
    -
    361 typedef struct _keyval_pair
    -
    362 {
    -
    363  struct _keyval_pair *next;
    -
    364  hashtable_size_t key_size;
    -
    365  hashtable_size_t value_size;
    -
    366  uint8_t data[];
    -
    367 } _HASHTABLE_PACKED _keyval_pair_t;
    -
    368 
    -
    369 
    -
    373 typedef struct
    -
    374 {
    -
    375  _keyval_pair_t *head;
    -
    376  _keyval_pair_t *tail;
    -
    377 } _keyval_pair_list_t;
    -
    378 
    -
    379 
    -
    383 typedef struct
    -
    384 {
    -
    385  _keyval_pair_list_t freelist;
    -
    386  size_t total_bytes;
    -
    387  size_t bytes_used;
    -
    388  uint8_t data[];
    -
    389 } _keyval_pair_data_block_t;
    -
    390 
    -
    391 
    -
    395 typedef struct
    -
    396 {
    -
    397  uint32_t array_count;
    -
    398  _keyval_pair_list_t table[];
    -
    399 } _keyval_pair_list_table_t;
    -
    400 
    -
    401 
    -
    433 typedef struct
    -
    434 {
    -
    435  _keyval_pair_list_table_t *list_table;
    -
    436  _keyval_pair_data_block_t *data_block;
    -
    437  uint32_t cursor_array_index;
    -
    438  uint32_t cursor_items_traversed;
    -
    439  _keyval_pair_t *cursor_item;
    -
    440  uint8_t cursor_limit;
    -
    441 } _keyval_pair_table_data_t;
    -
    442 
    -
    443 #endif // HASHTABLE_API_H
    +
    129 #if defined(HASHTABLE_SIZE_T_UINT16)
    +
    130 typedef uint16_t hashtable_size_t;
    +
    131 #elif defined(HASHTABLE_SIZE_T_UINT32)
    +
    132 typedef uint32_t hashtable_size_t;
    +
    133 #elif defined(HASHTABLE_SIZE_T_SYS)
    +
    134 typedef size_t hashtable_size_t;
    +
    135 #else
    +
    136 #error("HASHTABLE_SIZE_T option not defined")
    +
    137 #endif // if defined....
    +
    138 
    +
    139 
    +
    143 #define HASHTABLE_MIN_ARRAY_COUNT (10u)
    +
    144 
    +
    145 
    +
    152 #define HASHTABLE_MIN_BUFFER_SIZE(array_count) \
    +
    153  (sizeof(_keyval_pair_table_data_t) + sizeof(_keyval_pair_list_table_t) + \
    +
    154  ((array_count) * sizeof(_keyval_pair_list_t)) + \
    +
    155  sizeof(_keyval_pair_data_block_t))
    +
    156 
    +
    157 
    +
    166 typedef uint32_t (*hashtable_hashfunc_t)(const char *data, const hashtable_size_t size);
    +
    167 
    +
    168 
    +
    172 typedef struct
    +
    173 {
    + +
    175  uint32_t array_count;
    + +
    177 
    +
    178 
    +
    182 typedef struct
    +
    183 {
    + +
    185  uint32_t entry_count;
    +
    186  size_t data_size;
    +
    187  void *table_data;
    +
    188 } hashtable_t;
    +
    189 
    +
    190 
    + +
    205  void *buffer, size_t buffer_size);
    +
    206 
    +
    207 
    +
    222 int hashtable_insert(hashtable_t *table, const char *key, const hashtable_size_t key_size,
    +
    223  const char *value, const hashtable_size_t value_size);
    +
    224 
    +
    225 
    +
    237 int hashtable_remove(hashtable_t *table, const char *key, const hashtable_size_t key_size);
    +
    238 
    +
    239 
    +
    252 int hashtable_retrieve(hashtable_t *table, const char *key, const hashtable_size_t key_size,
    +
    253  char **value, hashtable_size_t *value_size);
    +
    254 
    +
    255 
    +
    266 int hashtable_has_key(hashtable_t *table, const char *key, const hashtable_size_t key_size);
    +
    267 
    +
    268 
    +
    278 int hashtable_bytes_remaining(hashtable_t *table, size_t *bytes_remaining);
    +
    279 
    +
    280 
    +
    297 int hashtable_next_item(hashtable_t *table, char **key, hashtable_size_t *key_size,
    +
    298  char **value, hashtable_size_t *value_size);
    +
    299 
    +
    300 
    + +
    312 
    +
    313 
    + +
    323 
    +
    324 
    +
    335 int hashtable_default_config(hashtable_config_t *config, size_t buffer_size);
    +
    336 
    +
    337 
    + +
    347 
    +
    348 
    +
    353 #ifdef HASHTABLE_PACKED_STRUCT
    +
    354 #define _HASHTABLE_PACKED __attribute__((packed))
    +
    355 #else
    +
    356 #define _HASHTABLE_PACKED
    +
    357 #endif // HASHTABLE_PACKED_STRUCT
    +
    358 
    +
    359 
    +
    364 typedef struct _keyval_pair
    +
    365 {
    +
    366  struct _keyval_pair *next;
    +
    367  hashtable_size_t key_size;
    +
    368  hashtable_size_t value_size;
    +
    369  uint8_t data[];
    +
    370 } _HASHTABLE_PACKED _keyval_pair_t;
    +
    371 
    +
    372 
    +
    376 typedef struct
    +
    377 {
    +
    378  _keyval_pair_t *head;
    +
    379  _keyval_pair_t *tail;
    +
    380 } _keyval_pair_list_t;
    +
    381 
    +
    382 
    +
    386 typedef struct
    +
    387 {
    +
    388  _keyval_pair_list_t freelist;
    +
    389  size_t total_bytes;
    +
    390  size_t bytes_used;
    +
    391  uint8_t data[];
    +
    392 } _keyval_pair_data_block_t;
    +
    393 
    +
    394 
    +
    398 typedef struct
    +
    399 {
    +
    400  uint32_t array_count;
    +
    401  _keyval_pair_list_t table[];
    +
    402 } _keyval_pair_list_table_t;
    +
    403 
    +
    404 
    +
    436 typedef struct
    +
    437 {
    +
    438  _keyval_pair_list_table_t *list_table;
    +
    439  _keyval_pair_data_block_t *data_block;
    +
    440  uint32_t cursor_array_index;
    +
    441  uint32_t cursor_items_traversed;
    +
    442  _keyval_pair_t *cursor_item;
    +
    443  uint8_t cursor_limit;
    +
    444 } _keyval_pair_table_data_t;
    +
    445 
    +
    446 #endif // HASHTABLE_API_H
    int hashtable_default_config(hashtable_config_t *config, size_t buffer_size)
    int hashtable_create(hashtable_t *table, const hashtable_config_t *config, void *buffer, size_t buffer_size)
    int hashtable_next_item(hashtable_t *table, char **key, hashtable_size_t *key_size, char **value, hashtable_size_t *value_size)
    @@ -219,16 +219,17 @@
    int hashtable_reset_cursor(hashtable_t *table)
    int hashtable_clear(hashtable_t *table)
    int hashtable_insert(hashtable_t *table, const char *key, const hashtable_size_t key_size, const char *value, const hashtable_size_t value_size)
    -
    uint32_t(* hashtable_hashfunc_t)(const char *data, const hashtable_size_t size)
    Definition: hashtable_api.h:163
    +
    uint32_t(* hashtable_hashfunc_t)(const char *data, const hashtable_size_t size)
    Definition: hashtable_api.h:166
    +
    size_t hashtable_size_t
    Defines the type used to represent the size of keys and values stored in the hashtable.
    Definition: hashtable_api.h:134
    int hashtable_has_key(hashtable_t *table, const char *key, const hashtable_size_t key_size)
    -
    Configuration data for a single hashtable instance.
    Definition: hashtable_api.h:170
    -
    hashtable_hashfunc_t hash
    Hash function to use, must not be NULL.
    Definition: hashtable_api.h:171
    -
    uint32_t array_count
    Number of table array slots, must not be 0.
    Definition: hashtable_api.h:172
    -
    All data for a single hashtable instance.
    Definition: hashtable_api.h:180
    -
    uint32_t entry_count
    Number of entries in the table.
    Definition: hashtable_api.h:182
    -
    size_t data_size
    Size of data section.
    Definition: hashtable_api.h:183
    -
    void * table_data
    Pointer to buffer for data section.
    Definition: hashtable_api.h:184
    -
    hashtable_config_t config
    Hashtable config data.
    Definition: hashtable_api.h:181
    +
    Configuration data for a single hashtable instance.
    Definition: hashtable_api.h:173
    +
    hashtable_hashfunc_t hash
    Hash function to use, must not be NULL.
    Definition: hashtable_api.h:174
    +
    uint32_t array_count
    Number of table array slots, must not be 0.
    Definition: hashtable_api.h:175
    +
    All data for a single hashtable instance.
    Definition: hashtable_api.h:183
    +
    uint32_t entry_count
    Number of entries in the table.
    Definition: hashtable_api.h:185
    +
    size_t data_size
    Size of data section.
    Definition: hashtable_api.h:186
    +
    void * table_data
    Pointer to buffer for data section.
    Definition: hashtable_api.h:187
    +
    hashtable_config_t config
    Hashtable config data.
    Definition: hashtable_api.h:184