alloc && afree

#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 ;
} 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 ;
} void afree(char *p)
{
if(p >= allocbuf && p < allocbuf + ALLOCSIZE)
allocp = p;
}
上一篇:Winfrom控件使用


下一篇:Dynamic CRM 2013学习笔记(三十八)流程1 - 操作(action)开发与配置详解