still tracking blasted memory corruption bug.

This commit is contained in:
gardners 2012-04-20 17:12:21 +09:30
parent 5c52c8e274
commit 3059a5c3e9

View File

@ -353,13 +353,13 @@ int ob_dump(overlay_buffer *b,char *desc)
void *_serval_debug_malloc(unsigned int bytes,char *file,const char *func,int line)
{
void *r=malloc(bytes+SDM_GUARD_AFTER);
fprintf(stderr,"%s:%d:%s(): malloc(%d) -> %p\n",file,line,func,bytes,r);
fprintf(stderr,"%s:%d:%s(): malloc(%d) -> %p\n",file,line,func,bytes,r);
return r;
}
void *_serval_debug_calloc(unsigned int bytes,unsigned int count,char *file,const char *func,int line)
{
void *r=calloc(bytes+SDM_GUARD_AFTER,count);
void *r=calloc((bytes*count)+SDM_GUARD_AFTER,1);
fprintf(stderr,"%s:%d:%s(): calloc(%d,%d) -> %p\n",file,line,func,bytes,count,r);
return r;
}