new.h 1.2 KB

12345678910111213141516171819202122232425262728
  1. /* Storage allocation interface for bison,
  2. Copyright (C) 1984 Bob Corbett and Free Software Foundation, Inc.
  3. BISON is distributed in the hope that it will be useful, but WITHOUT ANY
  4. WARRANTY. No author or distributor accepts responsibility to anyone
  5. for the consequences of using it or for whether it serves any
  6. particular purpose or works at all, unless he says so in writing.
  7. Refer to the BISON General Public License for full details.
  8. Everyone is granted permission to copy, modify and redistribute BISON,
  9. but only under the conditions described in the BISON General Public
  10. License. A copy of this license is supposed to have been given to you
  11. along with BISON so you can know your rights and responsibilities. It
  12. should be in a file named COPYING. Among other things, the copyright
  13. notice and this notice must be preserved on all copies.
  14. In other words, you are welcome to use, share and improve this program.
  15. You are forbidden to forbid anyone else to use, share and improve
  16. what you give them. Help stamp out software-hoarding! */
  17. #define NEW(t) ((t *) allocate((unsigned) sizeof(t)))
  18. #define NEW2(n, t) ((t *) allocate((unsigned) ((n) * sizeof(t))))
  19. #define FREE(x) (x && free((char *) (x)))
  20. extern char *allocate();