File: LocalAlloc.h

package info (click to toggle)
kinput2 3.0-19
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,688 kB
  • ctags: 4,649
  • sloc: ansic: 45,508; makefile: 100; sh: 35
file content (24 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* $Id: LocalAlloc.h,v 1.2 1991/01/22 11:53:28 ishisone Rel $ */

/*
 * (fast) local allocator macro
 *
 * if you use gcc, don't worry.
 * if you use cc and have reliable alloca(), define HAVE_ALLOCA.
 */

#ifdef __GNUC__
#define LOCAL_ALLOC(x)	__builtin_alloca((unsigned int)(x))
#define LOCAL_FREE(x)
#else
#ifdef HAVE_ALLOCA
#ifdef INCLUDE_ALLOCA_H
#include <alloca.h>
#endif
#define LOCAL_ALLOC(x)	alloca((unsigned int)(x))
#define LOCAL_FREE(x)
#else
#define LOCAL_ALLOC(x)	malloc((unsigned int)(x))
#define LOCAL_FREE(x)	free((char *)(x))
#endif /* HAVE_ALLOCA */
#endif /* __GNUC__ */