Lines Matching refs:n
57 void *xcalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
75 # define xalloc_oversized(n, s) \ argument
76 ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n))
90 # define XNMALLOC(n, t) \ argument
91 ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
101 # define XCALLOC(n, t) \ argument
102 ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
108 void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
109 void *xnrealloc (void *p, size_t n, size_t s);
111 char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
119 static_inline void *xnmalloc (size_t n, size_t s) ATTRIBUTE_MALLOC;
121 xnmalloc (size_t n, size_t s) in xnmalloc() argument
123 if (xalloc_oversized (n, s)) in xnmalloc()
125 return xmalloc (n * s); in xnmalloc()
132 xnrealloc (void *p, size_t n, size_t s) in xnrealloc() argument
134 if (xalloc_oversized (n, s)) in xnrealloc()
136 return xrealloc (p, n * s); in xnrealloc()
197 size_t n = *pn; in x2nrealloc() local
201 if (! n) in x2nrealloc()
209 n = DEFAULT_MXFAST / s; in x2nrealloc()
210 n += !n; in x2nrealloc()
219 if ((size_t) -1 / 3 * 2 / s <= n) in x2nrealloc()
221 n += (n + 1) / 2; in x2nrealloc()
224 *pn = n; in x2nrealloc()
225 return xrealloc (p, n * s); in x2nrealloc()
231 static_inline char *xcharalloc (size_t n) ATTRIBUTE_MALLOC;
233 xcharalloc (size_t n) in xcharalloc() argument
235 return XNMALLOC (n, char); in xcharalloc()
254 xnrealloc (T *p, size_t n, size_t s) in xnrealloc() argument
256 return (T *) xnrealloc ((void *) p, n, s); in xnrealloc()