Commit 865b8917 authored by unknown's avatar unknown

Move function from header file to make it easier to debug


sql/item.cc:
  Move function to make it easier to debug
sql/item.h:
  Move function to make them easier to debug
parent 5ec889c7
......@@ -297,6 +297,22 @@ longlong Item::val_int_from_decimal()
}
void *Item::operator new(size_t size, Item *reuse, uint *rsize)
{
if (reuse && size <= reuse->rsize)
{
reuse->cleanup();
TRASH((void *)reuse, size);
if (rsize)
(*rsize)= reuse->rsize;
return (void *)reuse;
}
if (rsize)
(*rsize)= size;
return (void *)sql_alloc((uint)size);
}
Item::Item():
rsize(0), name(0), orig_name(0), name_length(0), fixed(0),
collation(&my_charset_bin, DERIVATION_COERCIBLE)
......
......@@ -233,20 +233,7 @@ class Item {
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
/* Special for SP local variable assignment - reusing slots */
static void *operator new(size_t size, Item *reuse, uint *rsize)
{
if (reuse && size <= reuse->rsize)
{
reuse->cleanup();
TRASH((void *)reuse, size);
if (rsize)
(*rsize)= reuse->rsize;
return (void *)reuse;
}
if (rsize)
(*rsize)= size;
return (void *)sql_alloc((uint)size);
}
static void *operator new(size_t size, Item *reuse, uint *rsize);
static void operator delete(void *ptr,size_t size) { TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment