home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d502 / cells.lha / CELLS / CELLSSource.lzh / cMemory.h < prev    next >
C/C++ Source or Header  |  1991-04-20  |  828b  |  25 lines

  1. /*
  2.  *  CELLS       An Implementation of the WireWorld cellular automata
  3.  *              as described in Scientific American, Jan 1990.
  4.  *
  5.  *              Copyright 1990 by Davide P. Cervone.
  6.  *  You may use this code, provided this copyright notice is kept intact.
  7.  *  See the CELLS.HELP file for complete information on distribution conditions.
  8.  */
  9.  
  10. /*
  11.  *  File:  cMemory.h            Defines for memory management
  12.  */
  13.  
  14.  
  15. #include <exec/memory.h>
  16.  
  17. #define NEWSTRUCT(s,p)   ((p)=(struct s *)AllocMem(sizeof(struct s),MEMF_CLEAR))
  18. #define FREESTRUCT(s,p)  FreeMem(p,sizeof(struct s))
  19. #define NEWCHAR(p,n)     ((p)=(char *)AllocMem(n+1,MEMF_CLEAR))
  20. #define FREECHAR(p,n)    FreeMem(p,n+1)
  21. #define NEWBLOCK(t,n,p)  ((p)=(t *)AllocMem(sizeof(t)*n,MEMF_CLEAR))
  22. #define FREEBLOCK(t,n,p) FreeMem(p,sizeof(t)*n)
  23.  
  24. extern APTR AllocMem();
  25.