11 /* hack for pic32 gcc */
24 static volatile int live_check_disable=0;
26 void live_check(const char *file,int line,int alloc)
28 static volatile char *top=NULL,*top_printed=NULL;
29 static volatile size_t largest=0,largest_printed=0;
31 volatile char *will=&mark-(alloc==-1 ? 0 : alloc);
35 if (live_check_disable<=0 && top!=top_printed) {
36 printf("live_check [%s:%d]: new top=0x%08lX\n",file,line,(long)top);
40 if (largest < top-will)
42 if (live_check_disable<=0 && largest!=largest_printed) {
43 printf("live_check [%s:%d]: largest=%ld\n",file,line,(long)largest);
45 largest_printed=largest;
47 if (largest >= STACKCHECK) {
48 if (live_check_disable<=0)
49 printf("live_check - aborting: limit=%d < largest=%ld!\n",STACKCHECK,(long)largest);
54 void live_disable(int how)
56 live_check_disable+=how;
59 #define STACKCHECK_HEADER_PC_OFFSET 16
63 volatile static inside=0;
65 volatile int fp_alloc;
67 asm("movel %%d0,%0" : "=r" (fp_alloc) : /* input */ : "d0");
68 asm("movel %%fp@(4),%0" : "=r" (func) : /* input */);
74 if (live_check_disable<=0)
75 printf("mcount(func=0x%08lX,fp_alloc=%d)\n",((long)func)-STACKCHECK_HEADER_PC_OFFSET,-fp_alloc);
77 LIVE_ALLOC((-fp_alloc)+4);
78 #endif /* LIVE_ALLOC */
83 #endif /* STACKCHECK */