标签:color class size har static div ati log amp
#define ALLOCSIZE 10000 static char allocbuf[ALLOCSIZE]; static char *allocp = allocbuf; char *alloc(int n) { if(allocbuf + ALLOCSIZE - allocp >= n){ allocp += n; return allocp - n; }else return 0; } void afree(char *p) { if(p >= allocbuf && p < allocbuf + ALLOCSIZE) allocp = p; } #define ALLOCSIZE static char allocbuf[ALLOCSIZE]; static char *allocp = allocbuf; char *alloc(int n) { if(allocbuf + ALLOCSIZE - allocp >= n){ allocp += n; return allocp - n; }else return 0; } void afree(char *p) { if(p >= allocbuf && p < allocbuf + ALLOCSIZE) allocp = p; }
标签:color class size har static div ati log amp
原文地址:http://www.cnblogs.com/xkxf/p/6149645.html