gsasl  1.10.0
About: GNU SASL is an implementation of the Simple Authentication and Security Layer (SASL). Development version.
  Fossies Dox: gsasl-1.10.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

malloca.h File Reference
#include <alloca.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include "xalloc-oversized.h"
Include dependency graph for malloca.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define safe_alloca(N)   ((N) < 4032 ? alloca (N) : NULL)
 
#define malloca(N)
 
#define nmalloca(n, s)   (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s)))
 
#define sa_alignof(type)   offsetof (struct { char __slot1; type __slot2; }, __slot2)
 

Enumerations

enum  {
  sa_alignment_long = offsetof (struct { char __slot1; long __slot2; }, __slot2) , sa_alignment_double = offsetof (struct { char __slot1; double __slot2; }, __slot2) , sa_alignment_longlong = offsetof (struct { char __slot1; long long __slot2; }, __slot2) , sa_alignment_longdouble = offsetof (struct { char __slot1; long double __slot2; }, __slot2) ,
  sa_alignment_max
}
 

Functions

void * mmalloca (size_t n)
 
void freea (void *p)
 

Macro Definition Documentation

◆ malloca

#define malloca (   N)
Value:
((N) < 4032 - (2 * sa_alignment_max - 1) \
? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+ (2 * sa_alignment_max - 1)) \
& ~(uintptr_t)(2 * sa_alignment_max - 1)) \
: mmalloca (N))
#define alloca(size)
Definition: getopt.c:56
@ sa_alignment_max
Definition: malloca.h:117
void * mmalloca(size_t n)
Definition: malloca.c:43
#define uintptr_t
Definition: stdint.in.h:320

Definition at line 58 of file malloca.h.

◆ nmalloca

#define nmalloca (   n,
 
)    (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s)))

Definition at line 81 of file malloca.h.

◆ sa_alignof

#define sa_alignof (   type)    offsetof (struct { char __slot1; type __slot2; }, __slot2)

Definition at line 106 of file malloca.h.

◆ safe_alloca

#define safe_alloca (   N)    ((N) < 4032 ? alloca (N) : NULL)

Definition at line 49 of file malloca.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
sa_alignment_long 
sa_alignment_double 
sa_alignment_longlong 
sa_alignment_longdouble 
sa_alignment_max 

Definition at line 109 of file malloca.h.

Function Documentation

◆ freea()

void freea ( void *  p)

Definition at line 83 of file malloca.c.

◆ mmalloca()

void* mmalloca ( size_t  n)

Definition at line 43 of file malloca.c.