.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MEMCACHED_FREE" "3" "Mar 11, 2024" "1.1" "libmemcached-awesome" .SH NAME memcached_free \- libmemcached Documentation .SH SYNOPSIS .INDENT 0.0 .TP .B #include Compile and link with \-lmemcached .UNINDENT .INDENT 0.0 .TP .B typedef struct \fI\%memcached_st\fP memcached_st .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_st\fP *memcached_create(\fI\%memcached_st\fP *ptr) .INDENT 7.0 .TP .B Parameters \fBptr\fP \-\- pointer to user\-allocated \fI\%memcached_st\fP struct or null pointer .TP .B Returns pointer to initialized \fI\%memcached_st\fP struct .UNINDENT .UNINDENT .INDENT 0.0 .TP .B void memcached_free(\fI\%memcached_st\fP *ptr) .INDENT 7.0 .TP .B Parameters \fBptr\fP \-\- pointer to initialized \fI\%memcached_st\fP struct to destroy and possibly free .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fI\%memcached_st\fP *memcached_clone(\fI\%memcached_st\fP *destination, \fI\%memcached_st\fP *source) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdestination\fP \-\- pointer to user\-allocated \fI\%memcached_st\fP struct or null pointer .IP \(bu 2 \fBsource\fP \-\- pointer to initialized \fI\%memcached_st\fP struct to copy from .UNINDENT .TP .B Returns pointer to newly initialized \fI\%destination\fP, copied from \fI\%source\fP .UNINDENT .UNINDENT .INDENT 0.0 .TP .B void memcached_servers_reset(\fI\%memcached_st\fP *ptr) .INDENT 7.0 .TP .B Parameters \fBptr\fP \-\- pointer to initialized \fI\%memcached_st\fP struct .UNINDENT .UNINDENT .SH DESCRIPTION .sp \fI\%memcached_create()\fP is used to create a \fI\%memcached_st\fP structure that will then be used by other \fBlibmemcached\fP functions to communicate with the server. You should either pass a statically declared \fI\%memcached_st\fP to \fI\%memcached_create()\fP or a NULL. If a NULL passed in then a structure is allocated for you. .sp Please note, when you write new application use \fI\%memcached()\fP over \fI\%memcached_create()\fP\&. .sp \fI\%memcached_clone()\fP is similar to \fI\%memcached_create()\fP but it copies the defaults and list of servers from the source \fI\%memcached_st\fP pointer. If you pass a null as the argument for the source to clone, it is the same as a call to \fI\%memcached_create()\fP\&. If the destination argument is NULL a \fI\%memcached_st\fP will be allocated for you. .sp \fI\%memcached_servers_reset()\fP allows you to zero out the list of servers that the \fI\%memcached_st\fP has. .sp To clean up memory associated with a \fI\%memcached_st\fP structure you should pass it to \fI\%memcached_free()\fP when you are finished using it. \fI\%memcached_free()\fP is the only way to make sure all memory is deallocated when you finish using the structure. .sp You may wish to avoid using \fI\%memcached_create()\fP or \fI\%memcached_clone()\fP with a stack based allocation. The most common issues related to ABI safety involve heap allocated structures. .SH RETURN VALUE .sp \fI\%memcached_create()\fP returns a pointer to the \fI\%memcached_st\fP that was created (or initialized). On an allocation failure, it returns NULL. .sp \fI\%memcached_clone()\fP returns a pointer to the \fI\%memcached_st\fP that was created (or initialized). On an allocation failure, it returns NULL. .SH SEE ALSO .sp \fBmemcached(1)\fP \fBlibmemcached(3)\fP .\" Generated by docutils manpage writer. .