.\" 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 "TIFFMEMORY" "3tiff" "Jan 27, 2024" "4.5" "LibTIFF" .SH NAME TIFFmemory \- memory management-related functions for use with TIFF files .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX #include .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B tdata_t _TIFFmalloc(tsize_t size) .UNINDENT .INDENT 0.0 .TP .B tdata_t _TIFFrealloc(tdata_t buffer, tsize_t size) .UNINDENT .INDENT 0.0 .TP .B void _TIFFfree(tdata_t buffer) .UNINDENT .INDENT 0.0 .TP .B void _TIFFmemset(tdata_t s, int c, tsize_t n) .UNINDENT .INDENT 0.0 .TP .B void _TIFFmemcpy(tdata_t dest, const tdata_t src, tsize_t n) .UNINDENT .INDENT 0.0 .TP .B int _TIFFmemcmp(const tdata_t s1, const tdata_ts2, tsize_t n) .UNINDENT .INDENT 0.0 .TP .B void *_TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what) .UNINDENT .INDENT 0.0 .TP .B void *_TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what) .UNINDENT .SH DESCRIPTION .sp These routines are provided for writing portable software that uses \fBlibtiff\fP; they hide any memory\-management related issues, such as dealing with segmented architectures found on 16\-bit machines. .sp \fI\%_TIFFmalloc()\fP and \fI\%_TIFFrealloc()\fP are used to dynamically allocate and reallocate memory used by \fBlibtiff\fP; such as memory passed into the I/O routines. Memory allocated through these interfaces is released back to the system using the \fI\%_TIFFfree()\fP routine. .sp Memory allocated through one of the above interfaces can be set to a known value using \fI\%_TIFFmemset()\fP, copied to another memory location using \fI\%_TIFFmemcpy()\fP, or compared for equality using \fI\%_TIFFmemcmp()\fP\&. These routines conform to the equivalent C routines: \fBmemset()\fP, \fBmemcpy()\fP, \fBmemcmp()\fP, respectively. .sp \fI\%_TIFFCheckMalloc()\fP and \fI\%_TIFFCheckRealloc()\fP are checking for integer overflow before calling \fI\%_TIFFmalloc()\fP and \fI\%_TIFFrealloc()\fP, respectively. .SH DIAGNOSTICS .sp None. .SH SEE ALSO .sp malloc (3), memory (3), \fI\%libtiff\fP (3tiff) .SH AUTHOR LibTIFF contributors .SH COPYRIGHT 1988-2024, LibTIFF contributors .\" Generated by docutils manpage writer. .