/*
 *  CELLS       An Implementation of the WireWorld cellular automata
 *              as described in Scientific American, Jan 1990.
 *
 *              Copyright 1990 by Davide P. Cervone.
 *  You may use this code, provided this copyright notice is kept intact.
 *  See the CELLS.HELP file for complete information on distribution conditions.
 */

/*
 *  File:  cMemory.h            Defines for memory management
 */


#include <exec/memory.h>

#define NEWSTRUCT(s,p)   ((p)=(struct s *)AllocMem(sizeof(struct s),MEMF_CLEAR))
#define FREESTRUCT(s,p)  FreeMem(p,sizeof(struct s))
#define NEWCHAR(p,n)     ((p)=(char *)AllocMem(n+1,MEMF_CLEAR))
#define FREECHAR(p,n)    FreeMem(p,n+1)
#define NEWBLOCK(t,n,p)  ((p)=(t *)AllocMem(sizeof(t)*n,MEMF_CLEAR))
#define FREEBLOCK(t,n,p) FreeMem(p,sizeof(t)*n)

extern APTR AllocMem();
