'\" t .\" Title: tlsrpt_set_malloc_and_free .\" Author: Boris Lohner .\" Generator: Asciidoctor 1.5.6.1 .\" Date: 2024-11-06 .\" Manual: tlsrpt_set_malloc_and_free .\" Source: tlsrpt_set_malloc_and_free .\" Language: English .\" .TH "TLSRPT_SET_MALLOC_AND_FREE" "3" "2024-11-06" "tlsrpt_set_malloc_and_free" "tlsrpt_set_malloc_and_free" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \\$2 \(laURL: \\$1 \(ra\\$3 .. .if \n[.g] .mso www.tmac .LINKSTYLE blue R < > .SH "NAME" tlsrpt_set_malloc_and_free \- replaces the malloc implementation used within libtlsrpt .SH "SYNOPSIS" .sp #include .sp void tlsrpt_set_malloc_and_free(void* (*malloc_function)(size_t size), void (*free_function)(void *ptr)) .SH "DESCRIPTION" .sp The \f[CR]tlsrpt_set_malloc_and_free\fP function replaces the malloc implementation used within libtlsrpt. The replaced malloc is used within libtlsrpt only to allocate the \f[CR]struct tlsrpt_connection_t\fP and \f[CR]struct tlsrpt_dr_t\fP structures. Other malloc calls from within the C standard library are not affected. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 .B Note .ps -1 .br .sp This function must be called before any of the allocating functions \f[CR]tlsrpt_open\fP and \f[CR]tlsrpt_init_delivery_request\fP is called! Otherwise one malloc implementation tries to free a pointer allocated by a different malloc implementation. .sp .5v .RE .SH "RETURN VALUE" .sp The tlsrpt_set_malloc_and_free function has no return value. .SH "SEE ALSO" .sp \fBtlsrpt_open\fP(3), \fBtlsrpt_init_delivery_request\fP(3) .SH "AUTHOR(S)" .sp \fBBoris Lohner\fP .RS 4 Author(s). .RE