Enhance --log-malloc

Log callers of wrapper functions of realloc()
These are expand_buf() and expand_workspace()
This commit is contained in:
Simon Kelley committed 2026-02-03 22:33:32 +00:00
1 parent 578ea08391
commit 5f0f6aa9b1
3 files changed
+53 -47

No files matched your search

-21
View File
@@ -337,27 +337,6 @@ short *rrfilter_desc(int type)
return p+1;
}
int expand_workspace(unsigned char ***wkspc, int *szp, int new)
{
unsigned char **p;
int old = *szp;
if (old >= new+1)
return 1;
new += 5;
if (!(p = whine_realloc(*wkspc, new * sizeof(unsigned char *))))
return 0;
memset(p+old, 0, new-old);
*wkspc = p;
*szp = new;
return 1;
}
/* Convert from presentation format to wire format, in place.
Also map UC -> LC.
Note that using extract_name to get presentation format