home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
500-599
/
ff502.lzh
/
CELLS
/
CELLSSource.lzh
/
cMemory.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-20
|
828b
|
25 lines
/*
* 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();