* lib/malloc.c: Include stdckdint.h, xalloc-oversized.h.
(rpl_malloc): Use ckd_mul instead of xalloc_oversized.
* modules/malloc-gnu, modules/malloc-posix:
(Depends-on): Depend on stdckdint, not xalloc-oversized.
2024-11-04 Paul Eggert <eggert@cs.ucla.edu>
+ malloc-gnu: depend on stdckdint not xalloc-oversized
+ * lib/malloc.c: Include stdckdint.h, xalloc-oversized.h.
+ (rpl_malloc): Use ckd_mul instead of xalloc_oversized.
+ * modules/malloc-gnu, modules/malloc-posix:
+ (Depends-on): Depend on stdckdint, not xalloc-oversized.
+
calloc: depend on stdckdint not xalloc-oversized
* lib/calloc.c: Include stdckdint.h, xalloc-oversized.h.
(rpl_calloc): Use ckd_mul instead of xalloc_oversized.
#include <stdlib.h>
#include <errno.h>
-
-#include "xalloc-oversized.h"
+#include <stdckdint.h>
/* Allocate an N-byte block of memory from the heap, even if N is 0. */
if (n == 0)
n = 1;
- if (xalloc_oversized (n, 1))
+ ptrdiff_t signed_n;
+ if (ckd_add (&signed_n, n, 0))
{
errno = ENOMEM;
return NULL;
Depends-on:
malloc-posix
extensions-aix
-xalloc-oversized [test $REPLACE_MALLOC_FOR_MALLOC_GNU = 1]
+stdckdint [test $REPLACE_CALLOC_FOR_MALLOC_GNU = 1]
configure.ac:
gl_FUNC_MALLOC_GNU
m4/malloc.m4
Depends-on:
+stdckdint [test $REPLACE_CALLOC_FOR_MALLOC_POSIX = 1]
stdlib
-xalloc-oversized [test $REPLACE_MALLOC_FOR_MALLOC_POSIX = 1]
configure.ac:
AC_REQUIRE([gl_FUNC_MALLOC_POSIX])