home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / s / snip1292.zip / JMALLOC.H < prev    next >
C/C++ Source or Header  |  1992-07-03  |  1KB  |  34 lines

  1. /*-------------------------[ jmalloc.h ]------------------------*/
  2. /*                 drop-in for malloc with diags                */
  3. /*--------------------------------------------------------------*/
  4.  
  5. typedef struct mlist
  6. {
  7.     struct mlist *NextLink;         /* link to next struct */
  8.     char *MAddr;                    /* address assigned    */
  9.     unsigned MSize;                 /* size allocated      */
  10. } MLINK;
  11.  
  12. /*--------------------------------------------------------------*/
  13. /*--------------------[ public prototypes ]---------------------*/
  14. /*--------------------------------------------------------------*/
  15.  
  16. #ifdef DBUG
  17. void *JMalloc(unsigned size);
  18. void *JCalloc(unsigned size, unsigned sizeach);
  19. void j_free(void *AllocAddr, char *file, int line);
  20. #define JFree(a) j_free(a, __FILE__, __LINE__)
  21. int JMemcheck(void);
  22. #else
  23. #define JMalloc(a) malloc(a)
  24. #define JCalloc((a), (b)) calloc((a), (b))
  25. #define JFree(a) free(a)
  26. #define JMemcheck(a)
  27. #endif
  28.  
  29. /*--------------------------------------------------------------*/
  30. /*---------------------[ public variables ]---------------------*/
  31. /*--------------------------------------------------------------*/
  32.  
  33. extern MLINK *MalTop;
  34.