w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cairo-malloc-private.h File Reference
#include "cairo-wideint-private.h"
#include <stdlib.h>
Include dependency graph for cairo-malloc-private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAIRO_INJECT_FAULT()   0
 
#define _cairo_malloc(size)    ((size) > 0 ? malloc((unsigned) (size)) : NULL)
 
#define _cairo_malloc_ab(a, size)
 
#define _cairo_realloc_ab(ptr, a, size)
 
#define _cairo_malloc_abc(a, b, size)
 
#define _cairo_malloc_ab_plus_c(a, size, c)
 

Macro Definition Documentation

◆ _cairo_malloc

#define _cairo_malloc (   size)     ((size) > 0 ? malloc((unsigned) (size)) : NULL)

_cairo_malloc: @size: size in bytes

Allocate @size memory using malloc(). The memory should be freed using free(). malloc is skipped, if 0 bytes are requested, and NULL will be returned.

Return value: A pointer to the newly allocated memory, or NULL in case of malloc() failure or size is 0.

Definition at line 62 of file cairo-malloc-private.h.

◆ _cairo_malloc_ab

#define _cairo_malloc_ab (   a,
  size 
)
Value:
((size) && (unsigned) (a) >= INT32_MAX / (unsigned) (size) ? NULL : \
_cairo_malloc((unsigned) (a) * (unsigned) (size)))
#define _cairo_malloc(size)
#define a(n)
Definition: gpos-common.c:148
#define NULL
Definition: ftobjs.h:61
#define INT32_MAX
Definition: stdint.h:137
static int size
Definition: ppmlabel.c:24

_cairo_malloc_ab: : number of elements to allocate @size: size of each element

Allocates *@size memory using _cairo_malloc(), taking care to not overflow when doing the multiplication. Behaves much like calloc(), except that the returned memory is not set to zero. The memory should be freed using free().

@size should be a constant so that the compiler can optimize out a constant division.

Return value: A pointer to the newly allocated memory, or NULL in case of malloc() failure or overflow.

Definition at line 82 of file cairo-malloc-private.h.

◆ _cairo_malloc_ab_plus_c

#define _cairo_malloc_ab_plus_c (   a,
  size,
  c 
)
Value:
((size) && (unsigned) (a) >= INT32_MAX / (unsigned) (size) ? NULL : \
(unsigned) (c) >= INT32_MAX - (unsigned) (a) * (unsigned) (size) ? NULL : \
_cairo_malloc((unsigned) (a) * (unsigned) (size) + (unsigned) (c)))
#define c(n)
Definition: gpos-common.c:150

_cairo_malloc_ab_plus_c: : number of elements to allocate @size: size of each element : additional size to allocate

Allocates *@size+memory using _cairo_malloc(), taking care to not overflow when doing the arithmetic. Behaves similar to _cairo_malloc_ab(). The memory should be freed using free().

Return value: A pointer to the newly allocated memory, or NULL in case of malloc() failure or overflow.

Definition at line 144 of file cairo-malloc-private.h.

◆ _cairo_malloc_abc

#define _cairo_malloc_abc (   a,
  b,
  size 
)
Value:
((b) && (unsigned) (a) >= INT32_MAX / (unsigned) (b) ? NULL : \
(size) && (unsigned) ((a)*(b)) >= INT32_MAX / (unsigned) (size) ? NULL : \
_cairo_malloc((unsigned) (a) * (unsigned) (b) * (unsigned) (size)))
#define b
Definition: jpegint.h:372

_cairo_malloc_abc: : first factor of number of elements to allocate : second factor of number of elements to allocate @size: size of each element

Allocates **@size memory using _cairo_malloc(), taking care to not overflow when doing the multiplication. Behaves like _cairo_malloc_ab(). The memory should be freed using free().

@size should be a constant so that the compiler can optimize out a constant division.

Return value: A pointer to the newly allocated memory, or NULL in case of malloc() failure or overflow.

Definition at line 125 of file cairo-malloc-private.h.

◆ _cairo_realloc_ab

#define _cairo_realloc_ab (   ptr,
  a,
  size 
)
Value:
((size) && (unsigned) (a) >= INT32_MAX / (unsigned) (size) ? NULL : \
realloc(ptr, (unsigned) (a) * (unsigned) (size)))
#define realloc
Definition: glob.c:206
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr

_cairo_realloc_ab: @ptr: original pointer to block of memory to be resized : number of elements to allocate @size: size of each element

Reallocates @ptr a block of *@size memory using realloc(), taking care to not overflow when doing the multiplication. The memory should be freed using free().

@size should be a constant so that the compiler can optimize out a constant division.

Return value: A pointer to the newly allocated memory, or NULL in case of realloc() failure or overflow (whereupon the original block of memory * is left untouched).

Definition at line 104 of file cairo-malloc-private.h.

◆ CAIRO_INJECT_FAULT

#define CAIRO_INJECT_FAULT ( )    0

Definition at line 47 of file cairo-malloc-private.h.