home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / INCLUDE.ZIP / MALLOC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  1.2 KB  |  40 lines

  1. /*  malloc.h
  2.  
  3.     memory management functions and variables.
  4.  
  5.     Copyright (c) 1991 by Borland International
  6.     All Rights Reserved.
  7. */
  8.  
  9. #if !defined(__MALLOC_H)
  10. #define __MALLOC_H
  11.  
  12. #if !defined(__ALLOC_H)
  13. #include <alloc.h>
  14. #endif
  15.  
  16. #if defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__)
  17.  
  18. /* Near heap functions currently allowed only in small data models */
  19.  
  20. #define _nmalloc(size)          malloc(size)
  21. #define _nfree(block)           free(block)
  22. #define _nrealloc(block,size)   realloc(block,size)
  23. #define _ncalloc(num,size)      calloc(num,size)
  24. #define _nheapmin()             0
  25. #define _memavl()               coreleft()
  26.  
  27. #endif  /* small data models */
  28.  
  29. /* Model-independent functions */
  30.  
  31. #define _fmalloc(size)          farmalloc((unsigned long)(size))
  32. #define _ffree(block)           farfree(block)
  33. #define _frealloc(block,size)   farrealloc(block,(unsigned long)(size))
  34. #define _fcalloc(num,size)      farcalloc((unsigned long)(num),(unsigned long)(size))
  35. #define halloc(num,size)        (void huge *)farmalloc((unsigned long)(num)*(size))
  36. #define hfree(block)            farfree((void far *)(block))
  37. #define _heapmin()              0
  38. #define _fheapmin()             0
  39.  
  40. #endif