void *youd_mem_malloc(int size)
{
void *p = YOUD_NULL;
p = malloc(size);
if(p!=NULL)
{
memset(p, 0, size);
}
m=0;
while(m<MAX_SIZE)
{
if(g_m[m].ptr==NULL){
g_m[m].ptr=p;
g_m[m].size=size;
g_maxsize+=size;
YOUD_TRACE("youd_mem_malloc:gsa_YOUD_test[%d].size=%d, TOTAL_SIZE=%d", m, gsa_YOUD_test[m].size, YOUD_MEM_TOTAL_SIZE);
break;
}
m++;
}
return p;
}
void youd_mem_free(void *p)
{
m=0;
while(m<MAX_SIZE)
{
if(g_m[m].ptr==p){
g_m[m].ptr=NULL;
g_maxsize-=size;
g_m[m].size=0;
break;
}
m++;
}
free(p);
}
}