home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / snip9707.zip / JNEW.H < prev    next >
C/C++ Source or Header  |  1997-07-05  |  1KB  |  35 lines

  1. /* +++Date last modified: 05-Jul-1997 */
  2.  
  3. /*--------------------------------------------------------------*/
  4. /* Debugging extension by Jeff Dunlop                           */
  5. /* Copyright 1992-1993, DB/Soft Publishing Co.                  */
  6. /* License is hereby granted for use of JMalloc as a debugging  */
  7. /* aid in any program.  JMalloc may not be sold or distributed  */
  8. /* as or part of any for-profit debugging program or library    */
  9. /* nor may it be included in any for-profit library that offers */
  10. /* debugging features.  Any redistribution of JMalloc source    */
  11. /* must include this copyright notice.                          */
  12. /*--------------------------------------------------------------*/
  13.  
  14. #include <stdlib.h>
  15.  
  16. #ifndef jnew_h
  17. #define jnew_h
  18.  
  19. #ifdef DBUG
  20.  
  21. #define NEW(a) (db_set(__FILE__, __LINE__), new a)
  22. #define DELETE(a) (db_set(__FILE__, __LINE__), delete a)
  23.  
  24. void *operator new(size_t n);
  25. void operator delete(void *p);
  26. void db_set(char *file, int line);
  27.  
  28. #else
  29.  
  30. #define NEW(a) new a
  31. #define DELETE(a) delete a
  32.  
  33. #endif /* DBUG */
  34. #endif /* jnew_h */
  35.