[565] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

local allocation

jfc@ATHENA.MIT.EDU (jfc@ATHENA.MIT.EDU)
Tue Jan 8 17:27:15 1991

The X server defines 2 macros, ALLOCATE_LOCAL(size) and
DECALLOCATE_LOCAL(ptr) for stack memory management.  Normally,

	#define	ALLOCATE_LOCAL(size)	alloca(size)
	#define	DEALLOCATE_LOCAL(ptr)

If alloca isn't supported or isn't efficient (mips cc, for example),
you can define

	#define	ALLOCATE_LOCAL(size)	malloc(size)
	#define	DEALLOCATE_LOCAL(ptr)	free(ptr)

There may also be compiler dependencies.  hc calls alloca _Alloca.
gcc calls it __builtin_alloca.


home help back first fref pref prev next nref lref last post