storage.h 778 B

1234567891011121314151617181920212223
  1. /* $Header$ */
  2. /* S T R U C T U R E - S T O R A G E D E F I N I T I O N S */
  3. /* Storage allocation is one of the most expensive operations in
  4. the compiler and consequently much thought and experimentation
  5. has gone into it. To simplify the hooking in of new super-fancy
  6. algorithms, all allocating and freeing of storage for structs
  7. goes through the macros
  8. st_alloc(&head, size)
  9. st_free(ptr, head, size)
  10. which, hopefully, convey enough information.
  11. */
  12. extern char *head_alloc();
  13. #define st_alloc(headp, size) head_alloc((char **)headp, size)
  14. #ifndef BOTCH_FREE
  15. #define st_free(ptr, head, size) (ptr->next = head, head = ptr)
  16. #else def BOTCH_FREE
  17. #define st_free(ptr, head, size) (botch((char *)(ptr), size), \
  18. ptr->next = head, head = ptr)
  19. #endif BOTCH_FREE