real_size = (size > 0) ? size : 1;
p = malloc(real_size);
while (p == NULL) {
- (*xmalloc_error_handler)("malloc", size, file, line);
+ xmalloc_error_handler("malloc", size, file, line);
p = malloc(real_size);
}
return p;
size = (size > 0) ? size : 1;
p = calloc(n, size);
while (p == NULL) {
- (*xmalloc_error_handler)("calloc", n *size, file, line);
+ xmalloc_error_handler("calloc", n * size, file, line);
p = calloc(n, size);
}
return p;
# pragma GCC diagnostic ignored "-Wuse-after-free"
#endif
while (newp == NULL) {
- (*xmalloc_error_handler)("realloc", size, file, line);
+ xmalloc_error_handler("realloc", size, file, line);
newp = realloc(p, size);
}
return newp;
# pragma GCC diagnostic ignored "-Wuse-after-free"
#endif
while (newp == NULL) {
- (*xmalloc_error_handler)("reallocarray", n *size, file, line);
+ xmalloc_error_handler("reallocarray", n * size, file, line);
newp = reallocarray(p, n, size);
}
#if __GNUC__ >= 12 && !defined(__clang__)
len = strlen(s) + 1;
p = malloc(len);
while (p == NULL) {
- (*xmalloc_error_handler)("strdup", len, file, line);
+ xmalloc_error_handler("strdup", len, file, line);
p = malloc(len);
}
memcpy(p, s, len);
length = p - s;
copy = malloc(length + 1);
while (copy == NULL) {
- (*xmalloc_error_handler)("strndup", length + 1, file, line);
+ xmalloc_error_handler("strndup", length + 1, file, line);
copy = malloc(length + 1);
}
memcpy(copy, s, length);
status = vsnprintf(NULL, 0, fmt, args_copy);
va_end(args_copy);
status = (status < 0) ? 0 : status + 1;
- (*xmalloc_error_handler)("vasprintf", status, file, line);
+ xmalloc_error_handler("vasprintf", status, file, line);
va_copy(args_copy, args);
status = vasprintf(strp, fmt, args_copy);
va_end(args_copy);
status = vsnprintf(NULL, 0, fmt, args_copy);
va_end(args_copy);
status = (status < 0) ? 0 : status + 1;
- (*xmalloc_error_handler)("asprintf", status, file, line);
+ xmalloc_error_handler("asprintf", status, file, line);
va_copy(args_copy, args);
status = vasprintf(strp, fmt, args_copy);
va_end(args_copy);
status = vsnprintf(NULL, 0, fmt, args_copy);
va_end(args_copy);
status = (status < 0) ? 0 : status + 1;
- (*xmalloc_error_handler)("asprintf", status, __FILE__, __LINE__);
+ xmalloc_error_handler("asprintf", status, __FILE__, __LINE__);
va_copy(args_copy, args);
status = vasprintf(strp, fmt, args_copy);
va_end(args_copy);