Update the changelog
[opencv] / apps / Hawk / CVEiCL / EiC / src / ppc403 / include / xalloc.h
1 /* xalloc.h\r
2  *\r
3  *      (C) Copyright Dec 12 1995, Edmond J. Breen.\r
4  *                 ALL RIGHTS RESERVED.\r
5  * This code may be copied for personal, non-profit use only.\r
6  *\r
7  */\r
8 #ifndef XALLOCH\r
9 #define XALLOCH\r
10 \r
11 \r
12 \r
13 #define ymem\r
14 #ifdef ymem\r
15 \r
16 \r
17 #define xmalloc(N)          ymalloc(__FILE__,__LINE__,N)\r
18 #define xcalloc(N,M)        ycalloc(__FILE__,__LINE__,N,M)\r
19 #define xrealloc(N,M)       yrealloc(__FILE__,__LINE__,N,M)\r
20 #define xfree(N)            yfree(__FILE__,__LINE__,N)\r
21 #define xmark(N,M)          ymark(__FILE__,__LINE__,N,M)\r
22 #define xmemcheck()         ymemcheck(__FILE__,__LINE__)\r
23 #define xdumpnonmark(N,M)   ydumpnonmark(N,M)\r
24 \r
25 void  xfreemark(char mark);\r
26 int   xexchmark(char oldmark, char newmark);\r
27 int   xlookup(void *p);\r
28 \r
29 int getMemMark(unsigned long item);\r
30 void freeMemItem(unsigned long item);\r
31 \r
32 void   xalloc_CleanUp(size_t bot, size_t top);\r
33 size_t xalloc_NextEntryNum(void);\r
34 \r
35 void *ymalloc(char *file,int lineno, size_t nbytes);\r
36 void *ycalloc(char *file,int lineno,size_t nelem,size_t elemsize);\r
37 void *yrealloc(char *file,int lineno,void *block, size_t nbytes);\r
38 void yfree(char *file,int lineno,void *block);\r
39 int  ymark(char *file,int lineno,void *block,char mark);\r
40 void ydumpnonmark(char *outfile,char mark);\r
41 \r
42 \r
43 extern unsigned long tot_memory;   /* total amount of memory allocated */\r
44 extern size_t tot_alloc;           /* total number of blocks allocated */\r
45 extern size_t tot_seen;            /* total number of blocks seen */\r
46 extern char XGMARK;                /* memory mark, default = 0 */\r
47 \r
48 #define MEM_LEAK   66\r
49 #define NON_LEAK   50\r
50 \r
51 #define catchItem(X)  {size_t x = X; if(tot_seen == x)\\r
52                            printf("\n\tCAUGHT ITEM %lu at %d in %s\n\n",\\r
53                                   (unsigned long)x, __LINE__,__FILE__);}\r
54 \r
55 #else\r
56 #define xmalloc(N)              malloc(N)\r
57 #define xcalloc(N,M)            calloc(N,M)\r
58 #define xrealloc(N,M)           realloc(N,M)\r
59 #define xfree(N)                free(N)\r
60 \r
61 #endif\r
62 #endif\r
63 \r
64 \r
65 \r
66 \r
67 \r
68 \r
69 \r
70 \r