Mercurial > hg > dmlib
changeset 1784:a29d38862037
Improve DMGrowBuf debugging slightly.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 13 Jun 2018 01:37:36 +0300 |
parents | 1ce808599129 |
children | 86d10d5d4915 |
files | src/dmgrowbuf.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dmgrowbuf.c Wed Jun 13 01:34:46 2018 +0300 +++ b/src/dmgrowbuf.c Wed Jun 13 01:37:36 2018 +0300 @@ -171,6 +171,7 @@ // For buffers growing backwards, we must move the // current data to the end of the buffer .. size_t clrsize = nsize - buf->size; + DM_DBG(" clrsize=%" DM_PRIu_SIZE_T "\n", clrsize); if (buf->backwards) { memmove(buf->data + clrsize, buf->data, clrsize); @@ -208,6 +209,9 @@ (buf->backwards && amount >= buf->offs) || (!buf->backwards && buf->offs + amount >= buf->size)) { + DM_DBG("dmGrowBufGrow(%p, amount=%" DM_PRIu_SIZE_T "): grow=%" DM_PRIu_SIZE_T "\n", + buf, amount, grow); + if (!dmGrowBufRealloc(buf, buf->size + grow, TRUE)) return FALSE; }