home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 10.ddi / 017.LIF / _ALLOC.H next >
Encoding:
C/C++ Source or Header  |  1992-07-02  |  1.1 KB  |  44 lines

  1. /* _alloc.h - alloc and free header definitions
  2.  * $Version: 1.1 $
  3.  * Copyright (c) 1988-91 Intel Corporation, ALL RIGHTS RESERVED.
  4.  */
  5.  
  6. #ifndef __alloch
  7. #define __alloch
  8. /*lint -library */ 
  9.  
  10. #ifndef _limitsh
  11. #include <limits.h>
  12. #endif
  13.  
  14. #pragma fixedparams("_malloc_find", "_merge_free_blocks")
  15. #pragma fixedparams("_merge_free_lists", "_malloc_take", "_free")
  16.  
  17. #ifndef _free_list_item_t
  18. #define _free_list_item_t
  19. #pragma align (free_list_item)
  20. struct free_list_item {
  21.     struct free_list_item *next;
  22.     unsigned               length;
  23. };
  24. #endif
  25.  
  26. #ifndef NULL
  27. #define NULL ((void *)0)
  28. #endif
  29.  
  30. #define _FREE_LIST_SIZE   20
  31. #define FH_SIZE           sizeof(struct free_list_item)
  32. #define INTSIZE           sizeof(int)
  33. #define MIN_ALLOC         sizeof(int)
  34. #define MAX_ALLOC         (UINT_MAX - FH_SIZE)
  35.  
  36. void _merge_free_lists(void);
  37. int  _merge_free_blocks(struct free_list_item *);
  38. void _malloc_take(struct free_list_item *, unsigned);
  39. struct free_list_item *_malloc_find(unsigned);
  40. void _free(struct free_list_item *);
  41.  
  42. #endif /* __alloch */
  43.  
  44.