summaryrefslogtreecommitdiff
path: root/storage/connect/plugutil.c
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-04-05 19:26:32 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-04-05 19:26:32 +0200
commitb43e82dce63c07abe8de740b3bf18a33600ccac0 (patch)
treeb0258d5271b9969a409f1821ed6f662db7619c36 /storage/connect/plugutil.c
parentd95e797c929ffe66f23c881d32a56162257fa33c (diff)
downloadmariadb-git-b43e82dce63c07abe8de740b3bf18a33600ccac0.tar.gz
- Make memory allocation of VALBLK's more flexible (can be allocated
normally when too big to be suballocated) to handle big results. modified: storage/connect/valblk.cpp storage/connect/valblk.h - Add system variable connect_work_size giving the size of the CONNECT work area used for memory allocation. modified: storage/connect/ha_connect.cc storage/connect/plugutil.c storage/connect/user_connect.cc
Diffstat (limited to 'storage/connect/plugutil.c')
-rw-r--r--storage/connect/plugutil.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c
index cc06a3da96a..201aa5a4371 100644
--- a/storage/connect/plugutil.c
+++ b/storage/connect/plugutil.c
@@ -115,11 +115,6 @@ void htrc(char const *fmt, ...)
va_list ap;
va_start (ap, fmt);
-//if (trace == 0 || (trace == 1 && !debug) || !fmt) {
-// printf("In %s wrong trace=%d debug=%p fmt=%p\n",
-// __FILE__, trace, debug, fmt);
-// trace = 0;
-// } // endif trace
//if (trace == 1)
// vfprintf(debug, fmt, ap);
@@ -490,10 +485,9 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
size = ((size + 7) / 8) * 8; /* Round up size to multiple of 8 */
pph = (PPOOLHEADER)memp;
-#if defined(DEBUG2) || defined(DEBUG3)
- htrc("SubAlloc in %p size=%d used=%d free=%d\n",
- memp, size, pph->To_Free, pph->FreeBlk);
-#endif
+ if (trace > 2)
+ htrc("SubAlloc in %p size=%d used=%d free=%d\n",
+ memp, size, pph->To_Free, pph->FreeBlk);
if ((uint)size > pph->FreeBlk) { /* Not enough memory left in pool */
char *pname = "Work";
@@ -502,9 +496,8 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
"Not enough memory in %s area for request of %u (used=%d free=%d)",
pname, (uint) size, pph->To_Free, pph->FreeBlk);
-#if defined(DEBUG2) || defined(DEBUG3)
- htrc("%s\n", g->Message);
-#endif
+ if (trace)
+ htrc("PlugSubAlloc: %s\n", g->Message);
longjmp(g->jumper[g->jump_level], 1);
} /* endif size OS32 code */
@@ -515,10 +508,11 @@ void *PlugSubAlloc(PGLOBAL g, void *memp, size_t size)
memp = MakePtr(memp, pph->To_Free); /* Points to suballocated block */
pph->To_Free += size; /* New offset of pool free block */
pph->FreeBlk -= size; /* New size of pool free block */
-#if defined(DEBUG2) || defined(DEBUG3)
- htrc("Done memp=%p used=%d free=%d\n",
- memp, pph->To_Free, pph->FreeBlk);
-#endif
+
+ if (trace > 2)
+ htrc("Done memp=%p used=%d free=%d\n",
+ memp, pph->To_Free, pph->FreeBlk);
+
return (memp);
} /* end of PlugSubAlloc */