view include/LocalAlloc.h @ 4:5b1d5c19f325

imported patch 06_kinput2-v3.1-wm_delete_window.patch
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 20:07:06 +0900
parents 92745d501b9a
children
line wrap: on
line source

/* $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__ */