NEW.H 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #define __STDC__ 1
  2. /* Storage allocation interface for bison,
  3. Copyright (C) 1984, 1989 Free Software Foundation, Inc.
  4. This file is part of Bison, the GNU Compiler Compiler.
  5. Bison is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 1, or (at your option)
  8. any later version.
  9. Bison is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Bison; see the file COPYING. If not, write to
  15. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  16. #define NEW(t) ((t *) mallocate((unsigned) sizeof(t)))
  17. #define NEW2(n, t) ((t *) mallocate((unsigned) ((n) * sizeof(t))))
  18. #ifdef __STDC__
  19. #define FREE(x) (x ? (void) free((char *) (x)) : (void)0)
  20. #else
  21. #define FREE(x) (x && free((char *) (x)))
  22. #endif
  23. extern char *mallocate();
  24.