home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dbmalloc.zip / malloc.h < prev    next >
C/C++ Source or Header  |  1993-07-27  |  21KB  |  625 lines

  1. /*
  2.  * (c) Copyright 1990, 1991, 1992 Conor P. Cahill (cpcahil@virtech.vti.com)
  3.  *
  4.  * This software may be distributed freely as long as the following conditions
  5.  * are met:
  6.  *         * the distribution, or any derivative thereof, may not be
  7.  *          included as part of a commercial product
  8.  *        * full source code is provided including this copyright
  9.  *        * there is no charge for the software itself (there may be
  10.  *          a minimal charge for the copying or distribution effort)
  11.  *        * this copyright notice is not modified or removed from any
  12.  *          source file
  13.  */
  14. /*
  15.  * $Id: malloc.h.org,v 1.38 1992/08/22 16:27:13 cpcahil Exp $
  16.  */
  17.  
  18. #ifndef _DEBUG_MALLOC_INC
  19. #define _DEBUG_MALLOC_INC 1
  20.  
  21. #ifdef    force_cproto_to_use_defines
  22.  
  23. /*
  24.  * these are just here because cproto used the c-preprocessor to generate
  25.  * the prototypes and if they were left as #defines the prototypes.h file
  26.  * would have the contents of the define, not the define itself
  27.  */
  28.  
  29. typedef char        DATATYPE;
  30. typedef int        SIZETYPE;
  31. typedef void        VOIDTYPE;
  32. typedef char        MEMDATA;
  33. typedef int        MEMSIZE;
  34. typedef int        STRSIZE;
  35. typedef int        FREETYPE;
  36. typedef int        EXITTYPE;
  37.  
  38. #ifdef WRTSIZE
  39. #undef WRTSIZE
  40. #endif
  41. typedef unsigned int    WRTSIZE;
  42.  
  43. /*
  44.  * for now, define CONST as const.  A sed script in the makefile will change 
  45.  * this back to CONST in the prototypes.h file.
  46.  */
  47. #define CONST const
  48.  
  49. #else  /* force_cproto_to_use_defines */
  50.  
  51. /*
  52.  * The following entries are automatically added by the Configure script.
  53.  * If they are not correct for your system, then Configure is not handling
  54.  * your system correctly.  Please report this to the author along with
  55.  * a description of your system and the correct values
  56.  */
  57.  
  58. #if  __GNUC__ && __STDC__
  59.  
  60. #define VOIDTYPE    void
  61. #define CONST        const
  62. #define EXITTYPE    void
  63. #define DATATYPE    void
  64. #define SIZETYPE    size_t
  65. #define FREETYPE    void
  66. #define MEMDATA        void
  67. #define MEMSIZE        size_t
  68. #define MEMCMPTYPE    unsigned char
  69. #define STRSIZE        size_t
  70. #define STRCMPTYPE    unsigned char
  71.  
  72. #else  /* __GNUC__ && __STDC__ */
  73.  
  74. #if       __GNUC__
  75.  
  76. #define VOIDTYPE     void
  77. #define CONST 
  78. #define EXITTYPE     void
  79. #define DATATYPE     void
  80. #define SIZETYPE    size_t
  81. #define FREETYPE    void
  82. #define MEMDATA        void
  83. #define MEMSIZE        size_t
  84. #define MEMCMPTYPE    unsigned char
  85. #define STRSIZE        size_t
  86. #define STRCMPTYPE    unsigned char
  87.  
  88. #else  /* __GNUC__ */
  89.  
  90. #define VOIDTYPE    void
  91. #define CONST 
  92. #define EXITTYPE    void
  93. #define DATATYPE    void
  94. #define SIZETYPE    size_t
  95. #define FREETYPE    void
  96. #define MEMDATA        void
  97. #define MEMSIZE        int
  98. #define MEMCMPTYPE    unsigned char
  99. #define STRSIZE        size_t
  100. #define STRCMPTYPE    unsigned char
  101.  
  102. #endif /* __GNUC__ */
  103.  
  104.  
  105. #endif /* __GNUC__ && __STDC__ */
  106.  
  107. /*
  108.  * END of automatic configuration stuff.
  109.  */
  110.  
  111. /*
  112.  * if DATATYPE is not defined, then the configure script must have had a 
  113.  * problem, or was used with a different compiler.  So we have to stop
  114.  * here and get the user to fix the problem.
  115.  */
  116. #ifndef   DATATYPE
  117.     /*
  118.      * the following string should cause a comilation error and get the
  119.      * user to look at this stuff to find out what is wrong.
  120.      */
  121.     "This file is not configured correctly for this system. Run configure
  122.      and check its results"
  123.     char * malloc(); /* DON'T REMOVE THIS LINE if you get a compiler error
  124.                 here it is because the malloc.h file is not 
  125.                 configured correctly  See the readme/problems
  126.                 files for more info */
  127.  
  128. #endif /* DATATYPE */
  129.  
  130. #endif /* force_cproto_to_use_defines */
  131.  
  132. #define VOIDCAST (VOIDTYPE)
  133.  
  134. /*
  135.  * since we redefine much of the stuff that is #defined in string.h and 
  136.  * memory.h, we should do what we can to make sure that they don't get 
  137.  * included after us.  This is typically accomplished by a special symbol
  138.  * (similar to _DEBUG_MALLOC_INC defined above) that is #defined when the
  139.  * file is included.  Since we don't want the file to be included we will
  140.  * #define the symbol ourselves.  These will typically have to change from
  141.  * one system to another.  I have put in several standard mechanisms used to
  142.  * support this mechanism, so hopefully you won't have to modify this file.
  143.  */
  144. #ifndef _H_STRING
  145. #define _H_STRING        1
  146. #endif 
  147. #ifndef __STRING_H
  148. #define __STRING_H        1
  149. #endif 
  150. #ifndef _STRING_H_
  151. #define _STRING_H_        1
  152. #endif 
  153. #ifndef _STRING_H 
  154. #define _STRING_H         1
  155. #endif 
  156. #ifndef _STRING_INCLUDED
  157. #define _STRING_INCLUDED    1
  158. #endif
  159. #ifndef __string_h
  160. #define __string_h        1
  161. #endif
  162. #ifndef _string_h
  163. #define _string_h        1
  164. #endif
  165. #ifndef __string_h__
  166. #define __string_h__        1
  167. #endif
  168. #ifndef _strings_h
  169. #define _strings_h        1
  170. #endif
  171. #ifndef __strings_h
  172. #define __strings_h        1
  173. #endif
  174. #ifndef __strings_h__
  175. #define __strings_h__        1
  176. #endif
  177. #ifndef _H_MEMORY
  178. #define _H_MEMORY        1
  179. #endif
  180. #ifndef __MEMORY_H
  181. #define __MEMORY_H        1
  182. #endif
  183. #ifndef _MEMORY_H_
  184. #define _MEMORY_H_        1
  185. #endif
  186. #ifndef _MEMORY_H
  187. #define _MEMORY_H        1
  188. #endif
  189. #ifndef _MEMORY_INCLUDED
  190. #define _MEMORY_INCLUDED    1
  191. #endif
  192. #ifndef __memory_h
  193. #define __memory_h        1
  194. #endif
  195. #ifndef _memory_h
  196. #define _memory_h        1
  197. #endif
  198. #ifndef __memory_h__
  199. #define __memory_h__        1
  200. #endif
  201.  
  202. /*
  203.  * for NCR, we need to disable their in-line expansion of the str* routines
  204.  */
  205. #define ISTRING    1
  206.  
  207. /*
  208.  * Malloc warning/fatal error handler defines...
  209.  */
  210. #define M_HANDLE_DUMP    0x80  /* 128 */
  211. #define M_HANDLE_IGNORE    0
  212. #define M_HANDLE_ABORT    1
  213. #define M_HANDLE_EXIT    2
  214. #define M_HANDLE_CORE    3
  215.     
  216. /*
  217.  * Mallopt commands and defaults
  218.  *
  219.  * the first four settings are ignored by the debugging dbmallopt, but are
  220.  * here to maintain compatibility with the system malloc.h.
  221.  */
  222. #define M_MXFAST    1        /* ignored by mallopt        */
  223. #define M_NLBLKS    2        /* ignored by mallopt        */
  224. #define M_GRAIN        3        /* ignored by mallopt        */
  225. #define M_KEEP        4        /* ignored by mallopt        */
  226. #define MALLOC_WARN    100        /* set malloc warning handling    */
  227. #define MALLOC_FATAL    101        /* set malloc fatal handling    */
  228. #define MALLOC_ERRFILE    102        /* specify malloc error file    */
  229. #define MALLOC_CKCHAIN    103        /* turn on chain checking    */
  230. #define MALLOC_FILLAREA    104        /* turn off area filling    */
  231. #define MALLOC_LOWFRAG    105        /* use best fit allocation mech    */
  232. #define MALLOC_CKDATA    106        /* turn off/on data checking    */
  233. #define MALLOC_REUSE    107        /* turn off/on freed seg reuse    */
  234. #define MALLOC_SHOWLINKS 108        /* turn off/on adjacent link disp */
  235. #define MALLOC_DETAIL    109        /* turn off/on detail output    */
  236. #define MALLOC_FREEMARK    110        /* warn about freeing marked segs*/
  237. #define MALLOC_ZERO    111        /* warn about zero len allocs    */
  238.  
  239. union dbmalloptarg
  240. {
  241.     int      i;
  242.     char    * str;
  243. };
  244.  
  245. /*
  246.  * disable the standard mallopt function
  247.  */
  248. #define mallopt(a,b)    (0)
  249.  
  250. /*
  251.  * Malloc warning/fatal error codes
  252.  */
  253. #define M_CODE_CHAIN_BROKE    1    /* malloc chain is broken    */
  254. #define M_CODE_NO_END        2    /* chain end != endptr        */
  255. #define M_CODE_BAD_PTR        3    /* pointer not in malloc area    */
  256. #define M_CODE_BAD_MAGIC    4    /* bad magic number in header    */
  257. #define M_CODE_BAD_CONNECT    5    /* chain poingers corrupt    */
  258. #define M_CODE_OVERRUN        6    /* data overrun in malloc seg    */
  259. #define M_CODE_REUSE        7    /* reuse of freed area        */
  260. #define M_CODE_NOT_INUSE    8    /* pointer is not in use    */
  261. #define M_CODE_NOMORE_MEM    9    /* no more memory available    */
  262. #define M_CODE_OUTOF_BOUNDS    10    /* gone beyound bounds         */
  263. #define M_CODE_FREELIST_BAD    11    /* inuse segment on freelist    */
  264. #define M_CODE_NOBOUND        12    /* can't calculate boundry    */
  265. #define M_CODE_STK_NOCUR    13    /* no current element on stack    */
  266. #define M_CODE_STK_BADFUNC    14    /* current func doesn't match    */
  267. #define M_CODE_UNDERRUN        15    /* data underrun in malloc seg    */
  268. #define M_CODE_FREEMARK        16    /* free of marked segment    */
  269. #define M_CODE_ZERO_ALLOC    17    /* zero length allocation    */
  270.  
  271. #ifndef __STDCARGS
  272. #if  __STDC__ || __cplusplus
  273. #define __STDCARGS(a) a
  274. #else
  275. #define __STDCARGS(a) ()
  276. #endif
  277. #endif
  278.  
  279. #if __cplusplus
  280. extern "C" {
  281. #endif
  282.  
  283. VOIDTYPE      malloc_dump __STDCARGS((int));
  284. VOIDTYPE      malloc_list __STDCARGS((int,unsigned long, unsigned long));
  285. int          dbmallopt __STDCARGS((int, union dbmalloptarg *));
  286. DATATYPE    * debug_calloc __STDCARGS((CONST char *,int,SIZETYPE,SIZETYPE));
  287. FREETYPE      debug_cfree __STDCARGS((CONST char *, int, DATATYPE *));
  288. FREETYPE      debug_free __STDCARGS((CONST char *, int, DATATYPE *));
  289. DATATYPE    * debug_malloc __STDCARGS((CONST char *,int, SIZETYPE));
  290. DATATYPE    * debug_realloc __STDCARGS((CONST char *,int,
  291.                         DATATYPE *,SIZETYPE));
  292. VOIDTYPE      DBmalloc_mark __STDCARGS((CONST char *,int, DATATYPE *));
  293. unsigned long      DBmalloc_inuse __STDCARGS((CONST char *,int,
  294.                         unsigned long *));
  295. int          DBmalloc_chain_check __STDCARGS((CONST char *,int,int));
  296. SIZETYPE      DBmalloc_size __STDCARGS((CONST char *,int,CONST DATATYPE *));
  297. DATATYPE    * DBmemalign __STDCARGS((CONST char *, int,SIZETYPE, SIZETYPE));
  298. void          StackEnter __STDCARGS((CONST char *, CONST char *, int));
  299. void          StackLeave __STDCARGS((CONST char *, CONST char *, int));
  300.  
  301. /*
  302.  * X allocation related prototypes
  303.  */
  304. char        * debug_XtMalloc __STDCARGS((CONST char *, int, unsigned int));
  305. char        * debug_XtRealloc __STDCARGS((CONST char *, int,
  306.                         char *, unsigned int));
  307. char        * debug_XtCalloc __STDCARGS((CONST char *, int,
  308.                         unsigned int, unsigned int));
  309. void          debug_XtFree __STDCARGS((CONST char *, int, char *));
  310. void        * debug_XtBCopy  __STDCARGS((CONST char *, int, char *,
  311.                         char *, int));
  312. extern void    (*XtAllocErrorHandler) __STDCARGS((CONST char *));
  313.  
  314. /*
  315.  * memory(3) related prototypes
  316.  */
  317. MEMDATA      * DBmemccpy __STDCARGS((CONST char *file, int line,
  318.                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  319.                     int ch, MEMSIZE len));
  320. MEMDATA      * DBmemchr __STDCARGS((CONST char *file, int line,
  321.                     CONST MEMDATA  *ptr1, int ch,
  322.                     MEMSIZE len));
  323. MEMDATA     * DBmemmove __STDCARGS((CONST char *file, int line,
  324.                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  325.                     MEMSIZE len));
  326. MEMDATA     * DBmemcpy __STDCARGS((CONST char *file, int line,
  327.                     MEMDATA  *ptr1, CONST MEMDATA  *ptr2,
  328.                     MEMSIZE len));
  329. int          DBmemcmp __STDCARGS((CONST char *file, int line,
  330.                     CONST MEMDATA  *ptr1,
  331.                     CONST MEMDATA  *ptr2, MEMSIZE len));
  332. MEMDATA     * DBmemset __STDCARGS((CONST char *file, int line,
  333.                     MEMDATA  *ptr1, int ch, MEMSIZE len));
  334. MEMDATA     * DBbcopy __STDCARGS((CONST char *file, int line,
  335.                     CONST MEMDATA  *ptr2, MEMDATA  *ptr1,
  336.                     MEMSIZE len));
  337. MEMDATA      * DBbzero __STDCARGS((CONST char *file, int line,
  338.                     MEMDATA  *ptr1, MEMSIZE len));
  339. int          DBbcmp __STDCARGS((CONST char *file, int line,
  340.                     CONST MEMDATA  *ptr2,
  341.                     CONST MEMDATA  *ptr1, MEMSIZE len));
  342.  
  343. /*
  344.  * string(3) related prototypes
  345.  */
  346. char        * DBstrcat __STDCARGS((CONST char *file,int line, char *str1,
  347.                     CONST char *str2));
  348. char        * DBstrdup __STDCARGS((CONST char *file, int line,
  349.                     CONST char *str1));
  350. char        * DBstrncat __STDCARGS((CONST char *file, int line, char *str1,
  351.                     CONST char *str2, STRSIZE len));
  352. int          DBstrcmp __STDCARGS((CONST char *file, int line,
  353.                     CONST char *str1, CONST char *str2));
  354. int          DBstrncmp __STDCARGS((CONST char *file, int line,
  355.                     CONST char *str1, CONST char *str2,
  356.                     STRSIZE len));
  357. int          DBstricmp __STDCARGS((CONST char *file, int line,
  358.                     CONST char *str1, CONST char *str2));
  359. int          DBstrincmp __STDCARGS((CONST char *file, int line,
  360.                     CONST char *str1, CONST char *str2,
  361.                     STRSIZE len));
  362. char        * DBstrcpy __STDCARGS((CONST char *file, int line, char *str1,
  363.                     CONST char *str2));
  364. char        * DBstrncpy __STDCARGS((CONST char *file, int line, char *str1,
  365.                     CONST char *str2, STRSIZE len));
  366. STRSIZE          DBstrlen __STDCARGS((CONST char *file, int line,
  367.                     CONST char *str1));
  368. char        * DBstrchr __STDCARGS((CONST char *file, int line,
  369.                     CONST char *str1, int c));
  370. char        * DBstrrchr __STDCARGS((CONST char *file, int line,
  371.                     CONST char *str1, int c));
  372. char        * DBindex __STDCARGS((CONST char *file, int line,
  373.                     CONST char *str1, int c));
  374. char        * DBrindex __STDCARGS((CONST char *file, int line,
  375.                     CONST char *str1, int c));
  376. char        * DBstrpbrk __STDCARGS((CONST char *file, int line,
  377.                     CONST char *str1, CONST char *str2));
  378. STRSIZE          DBstrspn __STDCARGS((CONST char *file, int line,
  379.                     CONST char *str1, CONST char *str2));
  380. STRSIZE          DBstrcspn __STDCARGS((CONST char *file, int line,
  381.                     CONST char *str1, CONST char *str2));
  382. char        * DBstrstr __STDCARGS((CONST char *file, int line,
  383.                     CONST char *str1, CONST char *str2));
  384. char        * DBstrtok __STDCARGS((CONST char *file, int line, char *str1,
  385.                     CONST char *str2));
  386.  
  387. #if __cplusplus
  388. };
  389. #endif
  390.  
  391. /*
  392.  * Macro which enables logging of the file and line number for each allocation
  393.  * so that it is easier to determine where the offending malloc comes from.
  394.  *
  395.  * NOTE that only code re-compiled with this include file will have this 
  396.  * additional info.  Calls from libraries that have not been recompiled will
  397.  * just have a null string for this info.
  398.  */
  399. #ifndef IN_MALLOC_CODE
  400.  
  401. /*
  402.  * allocation functions
  403.  */
  404. #define malloc(len)        debug_malloc( __FILE__,__LINE__, (len))
  405. #define realloc(ptr,len)    debug_realloc(__FILE__,__LINE__, (ptr), (len))
  406. #define calloc(numelem,size)    debug_calloc(__FILE__,__LINE__,(numelem),(size))
  407. #define cfree(ptr)        debug_cfree(__FILE__,__LINE__,(ptr))
  408. #define free(ptr)        debug_free(__FILE__,__LINE__,(ptr))
  409. #define malloc_chain_check(do)  DBmalloc_chain_check(__FILE__,__LINE__,(do))
  410. #define malloc_mark(ptr)    DBmalloc_mark(__FILE__,__LINE__,(ptr))
  411. #define malloc_inuse(histptr)    DBmalloc_inuse(__FILE__,__LINE__,(histptr))
  412. #define malloc_size(ptr)    DBmalloc_size(__FILE__,__LINE__,(ptr))
  413. #define memalign(align,size)    DBmemalign(__FILE__,__LINE__,(align),(size))
  414.  
  415. /* 
  416.  * X allocation routines
  417.  */
  418. #define XtCalloc(_num,_size)    debug_XtCalloc(__FILE__,__LINE__,_num,_size)
  419. #define XtMalloc(_size)        debug_XtMalloc(__FILE__,__LINE__,_size)
  420. #define XtRealloc(_ptr,_size)    debug_XtRealloc(__FILE__,__LINE__,_ptr,_size)
  421. #define XtFree(_ptr)        debug_XtFree(__FILE__,__LINE__,_ptr)
  422. #define _XtBCopy(ptr1,ptr2,len) debug_XtBcopy(__FILE__,__LINE__,ptr1,ptr2,len)
  423.  
  424. /*
  425.  * Other allocation functions
  426.  */
  427. #define _malloc(_size)        debug_malloc(__FILE__,__LINE__,_size)
  428. #define _realloc(_ptr,_size)    debug_realloc(__FILE__,__LINE__,_ptr,_size)
  429. #define _calloc(_num,_size)    debug_calloc(__FILE__,__LINE__,_num,_size)
  430. #define _free(_ptr)        debug_free(__FILE__,__LINE__,_ptr)
  431.  
  432. /*
  433.  * memory(3) related functions
  434.  */
  435. #ifdef bcopy
  436. #undef bcopy
  437. #endif
  438. #ifdef bzero
  439. #undef bzero
  440. #endif
  441. #ifdef bcmp
  442. #undef bcmp
  443. #endif
  444. #define memccpy(ptr1,ptr2,ch,len) DBmemccpy(__FILE__,__LINE__,ptr1,ptr2,ch,len)
  445. #define memchr(ptr1,ch,len)      DBmemchr(__FILE__,__LINE__,ptr1,ch,len)
  446. #define memmove(ptr1,ptr2,len)    DBmemmove(__FILE__,__LINE__,ptr1, ptr2, len)
  447. #define memcpy(ptr1,ptr2,len)     DBmemcpy(__FILE__, __LINE__, ptr1, ptr2, len)
  448. #define memcmp(ptr1,ptr2,len)     DBmemcmp(__FILE__,__LINE__,ptr1, ptr2, len)
  449. #define memset(ptr1,ch,len)       DBmemset(__FILE__,__LINE__,ptr1, ch, len)
  450. #define bcopy(ptr2,ptr1,len)      DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  451. #define bzero(ptr1,len)           DBbzero(__FILE__,__LINE__,ptr1,len)
  452. #define bcmp(ptr2,ptr1,len)       DBbcmp(__FILE__, __LINE__, ptr2, ptr1, len)
  453.  
  454. #define _bcopy(ptr2,ptr1,len)     DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  455. #define _bzero(ptr1,len)          DBbzero(__FILE__,__LINE__,ptr1,len)
  456. #define _bcmp(ptr2,ptr1,len)      DBbcmp(__FILE__,__LINE__,ptr2,ptr1,len)
  457. #define __dg_bcopy(ptr2,ptr1,len) DBbcopy(__FILE__,__LINE__,ptr2,ptr1,len)
  458. #define __dg_bzero(ptr1,len)      DBbzero(__FILE__,__LINE__,ptr1,len)
  459. #define __dg_bcmp(ptr2,ptr1,len)  DBbcmp(__FILE__,__LINE__,ptr2,ptr1,len)
  460.  
  461. /*
  462.  * string(3) related functions
  463.  */
  464. #ifdef index
  465. #undef index
  466. #endif
  467. #ifdef rindex
  468. #undef rindex
  469. #endif
  470. #ifdef strcpy
  471. #undef strcpy
  472. #endif
  473. #ifdef strcpy
  474. #undef strcmp
  475. #endif
  476. #define index(str1,c)          DBindex(__FILE__, __LINE__, str1, c)
  477. #define rindex(str1,c)          DBrindex(__FILE__, __LINE__, str1, c)
  478. #define strcat(str1,str2)      DBstrcat(__FILE__,__LINE__,str1,str2)
  479. #define strchr(str1,c)          DBstrchr(__FILE__, __LINE__, str1,c)
  480. #define strcmp(str1,str2)      DBstrcmp(__FILE__, __LINE__, str1, str2)
  481. #define strcpy(str1,str2)      DBstrcpy(__FILE__, __LINE__, str1, str2)
  482. #define strcspn(str1,str2)      DBstrcspn(__FILE__, __LINE__, str1,str2)
  483. #define strdup(str1)          DBstrdup(__FILE__, __LINE__, str1)
  484. #define stricmp(str1,str2)      DBstricmp(__FILE__, __LINE__, str1, str2)
  485. #define strincmp(str1,str2,len)      DBstrincmp(__FILE__, __LINE__, str1,str2,len)
  486. #define strlen(str1)          DBstrlen(__FILE__, __LINE__, str1)
  487. #define strncat(str1,str2,len)      DBstrncat(__FILE__, __LINE__, str1,str2,len)
  488. #define strncpy(str1,str2,len)      DBstrncpy(__FILE__,__LINE__,str1,str2,len)
  489. #define strncmp(str1,str2,len)      DBstrncmp(__FILE__, __LINE__, str1,str2,len)
  490. #define strpbrk(str1,str2)      DBstrpbrk(__FILE__, __LINE__, str1,str2)
  491. #define strrchr(str1,c)          DBstrrchr(__FILE__,__LINE__,str1,c)
  492. #define strspn(str1,str2)      DBstrspn(__FILE__, __LINE__, str1,str2)
  493. #define strstr(str1,str2)      DBstrstr(__FILE__, __LINE__, str1, str2)
  494. #define strtok(str1,str2)      DBstrtok(__FILE__, __LINE__, str1, str2)
  495.  
  496. /*
  497.  * malloc stack related functions
  498.  */
  499. #define malloc_enter(func)      StackEnter(func,__FILE__,__LINE__)
  500. #define malloc_leave(func)      StackLeave(func,__FILE__,__LINE__)
  501.  
  502. #endif /* IN_MALLOC_CODE */
  503.  
  504. #endif /* _DEBUG_MALLOC_INC */
  505.  
  506. /*
  507.  * $Log: malloc.h.org,v $
  508.  * Revision 1.38  1992/08/22  16:27:13  cpcahil
  509.  * final changes for pl14
  510.  *
  511.  * Revision 1.37  1992/08/18  11:42:00  cpcahil
  512.  * added more #defs to preclude memory/string.h inclusion
  513.  *
  514.  * Revision 1.36  1992/07/12  15:30:58  cpcahil
  515.  * Merged in Jonathan I Kamens' changes
  516.  *
  517.  * Revision 1.35  1992/07/03  00:03:25  cpcahil
  518.  * more fixes for pl13, several suggestons from Rich Salz.
  519.  *
  520.  * Revision 1.34  1992/07/02  15:35:52  cpcahil
  521.  * misc cleanups for PL13
  522.  *
  523.  * Revision 1.33  1992/07/02  13:49:54  cpcahil
  524.  * added support for new malloc_size function and additional tests to testerr
  525.  *
  526.  * Revision 1.32  1992/06/30  13:06:39  cpcahil
  527.  * added support for aligned allocations
  528.  *
  529.  * Revision 1.31  1992/06/22  23:40:10  cpcahil
  530.  * many fixes for working on small int systems
  531.  *
  532.  * Revision 1.30  1992/05/06  04:53:29  cpcahil
  533.  * performance enhancments
  534.  *
  535.  * Revision 1.29  1992/04/22  18:17:32  cpcahil
  536.  * added support for Xt Alloc functions, linted code
  537.  *
  538.  * Revision 1.28  1992/04/13  19:08:18  cpcahil
  539.  * fixed case insensitive stuff
  540.  *
  541.  * Revision 1.27  1992/04/13  18:41:18  cpcahil
  542.  * added case insensitive string comparison routines
  543.  *
  544.  * Revision 1.26  1992/04/13  17:26:25  cpcahil
  545.  * minor portability changes
  546.  *
  547.  * Revision 1.25  1992/04/13  14:13:18  cpcahil
  548.  * cleanup of log message.
  549.  *
  550.  * Revision 1.24  1992/04/13  03:09:14  cpcahil
  551.  * lots of changes.
  552.  *
  553.  * Revision 1.23  1992/03/01  12:42:38  cpcahil
  554.  * added support for managing freed areas and fixed doublword bndr problems
  555.  *
  556.  * Revision 1.22  1992/02/07  15:51:07  cpcahil
  557.  * mods for sun4
  558.  *
  559.  * Revision 1.21  1992/01/29  01:35:32  cpcahil
  560.  * added sgi definition.
  561.  *
  562.  * Revision 1.20  1992/01/28  21:42:25  cpcahil
  563.  * changes for the ibmRS6000
  564.  *
  565.  * Revision 1.19  1992/01/28  18:05:37  cpcahil
  566.  * misc fixes for patch 7
  567.  *
  568.  * Revision 1.18  1992/01/22  16:21:35  cpcahil
  569.  * added code to prevent inclusions of string.h and memory.h after malloc.h
  570.  * was included.
  571.  *
  572.  * Revision 1.17  1992/01/10  17:26:46  cpcahil
  573.  * fixed prototypes use of void.
  574.  *
  575.  * Revision 1.16  1992/01/10  16:53:39  cpcahil
  576.  * added more info on sizetype and datatype. added support for overriding
  577.  * use of void type.
  578.  *
  579.  * Revision 1.15  1992/01/09  17:19:11  cpcahil
  580.  * put the close brace in the correct position.
  581.  *
  582.  * Revision 1.14  1992/01/09  17:12:36  cpcahil
  583.  * added code to support inclusion in C++ modules
  584.  *
  585.  * Revision 1.13  1991/12/31  21:31:26  cpcahil
  586.  * changes for patch 6.  See CHANGES file for more info
  587.  *
  588.  * Revision 1.12  1991/12/26  22:31:29  cpcahil
  589.  * added check to make sure file is not included twice.
  590.  *
  591.  * Revision 1.11  1991/12/06  17:58:46  cpcahil
  592.  * added cfree() for compatibility with some wierd systems
  593.  *
  594.  * Revision 1.10  91/12/06  08:54:18  cpcahil
  595.  * cleanup of __STDC__ usage and addition of CHANGES file
  596.  * 
  597.  * Revision 1.9  91/12/04  09:23:40  cpcahil
  598.  * several performance enhancements including addition of free list
  599.  * 
  600.  * Revision 1.8  91/12/02  19:10:11  cpcahil
  601.  * changes for patch release 5
  602.  * 
  603.  * Revision 1.7  91/11/25  14:42:00  cpcahil
  604.  * Final changes in preparation for patch 4 release
  605.  * 
  606.  * Revision 1.6  91/11/24  00:49:28  cpcahil
  607.  * first cut at patch 4
  608.  * 
  609.  * Revision 1.5  91/11/20  11:54:10  cpcahil
  610.  * interim checkin
  611.  * 
  612.  * Revision 1.4  90/08/29  22:23:38  cpcahil
  613.  * fixed mallopt to use a union as an argument.
  614.  * 
  615.  * Revision 1.3  90/05/11  11:04:10  cpcahil
  616.  * took out some extraneous lines
  617.  * 
  618.  * Revision 1.2  90/05/11  00:13:09  cpcahil
  619.  * added copyright statment
  620.  * 
  621.  * Revision 1.1  90/02/23  07:09:03  cpcahil
  622.  * Initial revision
  623.  * 
  624.  */
  625.