Go to the documentation of this file.
62 #define PyMem_MALLOC _PyMem_DebugMalloc
63 #define PyMem_REALLOC _PyMem_DebugRealloc
64 #define PyMem_FREE _PyMem_DebugFree
74 #define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
75 : malloc((n) ? (n) : 1))
76 #define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
77 : realloc((p), (n) ? (n) : 1))
78 #define PyMem_FREE free
92 #define PyMem_New(type, n) \
93 ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
94 ( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
95 #define PyMem_NEW(type, n) \
96 ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
97 ( (type *) PyMem_MALLOC((n) * sizeof(type)) ) )
105 #define PyMem_Resize(p, type, n) \
106 ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
107 (type *) PyMem_Realloc((p), (n) * sizeof(type)) )
108 #define PyMem_RESIZE(p, type, n) \
109 ( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
110 (type *) PyMem_REALLOC((p), (n) * sizeof(type)) )
115 #define PyMem_Del PyMem_Free
116 #define PyMem_DEL PyMem_FREE
Copyright 2014 Google Inc. All rights reserved.