ck_hs_grow(3)

ck_hs_grow3

Enlarge hash set capacity

Usage

#include <ck_hs.h>

bool

ck_hs_grow(ck_hs_t *hs, unsigned long capacity);

Library

Concurrency Kit (libck, -lck)

Overview

The ck_hs_grow(3) function will resize the hash set in order to be able to store at least the number of entries specified by capacity at a load factor of one. The default hash set load factor is 0.5. If you wish to minimize the likelihood of memory allocations for a hash set meant to store n entries, then specify a capacity of 2n. The default behavior of ck_hs is to round capacity to the next power of two if it is not already a power of two.

Return values

Upon successful completion, ck_hs_grow(3) returns true and otherwise returns false on failure.

Errors

Behavior is undefined if hs is uninitialized. This function will only return false if there are internal memory allocation failures.

Releases

Unchanged in 5 releases since Debian 8 (Jessie).

  1. 8–13

From libck-dev 0.7.2-6 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.