1HASHKIT_IS_ALLOCATED(3)      libmemcached-awesome      HASHKIT_IS_ALLOCATED(3)
2
3
4

NAME

6       hashkit_is_allocated - libhashkit Documentation
7

SYNOPSIS

9       #include <libhashkit-1.0/hashkit.h>
10              Compile and link with -lhashkit
11
12       typedef struct hashkit_st hashkit_st
13
14       hashkit_st *hashkit_create(hashkit_st *hash)
15
16              Parameters
17                     hash  --  memory  address  of  a  hashkit_st struct; if a
18                     nullptr is passed, the struct will be  dynamically  allo‐
19                     cated by libhashkit
20
21              Returns
22                     pointer to initialized hashkit_st structure
23
24       hashkit_st  *hashkit_clone(hashkit_st  *destination,  const  hashkit_st
25       *ptr)
26
27              Parameters
28
29destination -- memory address of a  hashkit_st  struct;
30                       if  a nullptr is passed, the struct will be dynamically
31                       allocated by libhashkit
32
33ptr -- pointer of the hashkit_st struct to copy
34
35              Returns
36                     pointer to a hashkit_st structure  (destination,  if  not
37                     nullptr), initialized from ptr
38
39       void hashkit_free(hashkit_st *hash)
40
41              Parameters
42                     hash -- pointer to an initialized hashkit_st struct
43
44       bool hashkit_is_allocated(const hashkit_st *hash)
45
46              Parameters
47                     hash -- pointer to an initialized hashkit_st struct
48
49              Returns
50                     bool, whether the hash struct was dynamically allocated
51

DESCRIPTION

53       The  hashkit_create() function initializes a hashkit object for use. If
54       you pass a nullptr argument for hash, then the memory for the object is
55       allocated. If you specify a pre-allocated piece of memory, that is ini‐
56       tialized for use.
57
58       The hashkit_clone() function initializes a  hashkit  object  much  like
59       hashkit_create(), but instead of using default settings it will use the
60       settings of the ptr hashkit object.
61
62       The hashkit_free() frees any resources being consumed  by  the  hashkit
63       objects that were initialized with hashkit_create() or hashkit_clone().
64
65       The hashkit_is_allocated() reports whether the memory was allocated for
66       a hashkit object.
67

RETURN VALUE

69       hashkit_create() and hashkit_clone() will return nullptr on failure  or
70       pointer to hashkit_st on success.
71
72       hashkit_is_allocated()  returns  true if the memory for the hashkit ob‐
73       ject was allocated inside of hashkit_create() or hashkit_clone(),  oth‐
74       erwise it is false and was user-supplied memory.
75

SEE ALSO

77       libhashkit(3) hashkit_value(3) hashkit_function3)
78
79
80
81
821.1                              Nov 09, 2022          HASHKIT_IS_ALLOCATED(3)
Impressum