[PATCH 06/17] Add no-fail equivalents of allocarray & reallocarray
Matt Turner
mattst88 at gmail.com
Tue Mar 31 20:02:01 PDT 2015
On Tue, Mar 31, 2015 at 5:50 PM, Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> include/os.h | 9 +++++++++
> os/utils.c | 10 ++++++++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/include/os.h b/include/os.h
> index 2633741..bc624a2 100644
> --- a/include/os.h
> +++ b/include/os.h
> @@ -76,6 +76,8 @@ typedef struct _NewClientRec *NewClientPtr;
> #define xnfstrdup(s) XNFstrdup(s)
>
> #define xallocarray(num, size) reallocarray(NULL, (num), (size))
> +#define xnfallocarray(num, size) XNFreallocarray(NULL, (num), (size))
> +#define xnfreallocarray(ptr, num, size) XNFreallocarray((ptr), (num), (size))
> #endif
>
> #include <stdio.h>
> @@ -241,6 +243,13 @@ extern _X_EXPORT void *
> XNFrealloc(void * /*ptr */ , unsigned long /*amount */ );
>
> /*
> + * This function reallocarrays(3)s passed buffer, terminating the server if
Extra s on reallocarray.
More information about the xorg-devel
mailing list