1MEMCACHED_CLONE(3) libmemcached-awesome MEMCACHED_CLONE(3)
2
3
4
6 memcached_clone - libmemcached Documentation
7
9 #include <libmemcached/memcached.h>
10 Compile and link with -lmemcached
11
12 typedef struct memcached_st memcached_st
13
14 memcached_st *memcached_create(memcached_st *ptr)
15
16 Parameters
17 ptr -- pointer to user-allocated memcached_st struct or
18 null pointer
19
20 Returns
21 pointer to initialized memcached_st struct
22
23 void memcached_free(memcached_st *ptr)
24
25 Parameters
26 ptr -- pointer to initialized memcached_st struct to de‐
27 stroy and possibly free
28
29 memcached_st *memcached_clone(memcached_st *destination, memcached_st
30 *source)
31
32 Parameters
33
34 • destination -- pointer to user-allocated memcached_st
35 struct or null pointer
36
37 • source -- pointer to initialized memcached_st struct to
38 copy from
39
40 Returns
41 pointer to newly initialized destination, copied from
42 source
43
44 void memcached_servers_reset(memcached_st *ptr)
45
46 Parameters
47 ptr -- pointer to initialized memcached_st struct
48
50 memcached_create() is used to create a memcached_st structure that will
51 then be used by other libmemcached functions to communicate with the
52 server. You should either pass a statically declared memcached_st to
53 memcached_create() or a NULL. If a NULL passed in then a structure is
54 allocated for you.
55
56 Please note, when you write new application use memcached() over
57 memcached_create().
58
59 memcached_clone() is similar to memcached_create() but it copies the
60 defaults and list of servers from the source memcached_st pointer. If
61 you pass a null as the argument for the source to clone, it is the same
62 as a call to memcached_create(). If the destination argument is NULL a
63 memcached_st will be allocated for you.
64
65 memcached_servers_reset() allows you to zero out the list of servers
66 that the memcached_st has.
67
68 To clean up memory associated with a memcached_st structure you should
69 pass it to memcached_free() when you are finished using it.
70 memcached_free() is the only way to make sure all memory is deallocated
71 when you finish using the structure.
72
73 You may wish to avoid using memcached_create() or memcached_clone()
74 with a stack based allocation. The most common issues related to ABI
75 safety involve heap allocated structures.
76
78 memcached_create() returns a pointer to the memcached_st that was cre‐
79 ated (or initialized). On an allocation failure, it returns NULL.
80
81 memcached_clone() returns a pointer to the memcached_st that was cre‐
82 ated (or initialized). On an allocation failure, it returns NULL.
83
85 memcached(1) libmemcached(3)
86
87
88
89
901.1 Mar 06, 2023 MEMCACHED_CLONE(3)