cleanup: inherit from Sql_alloc

instead of copy-pasting its methods into a new class
This commit is contained in:
Sergei Golubchik 2014-08-16 08:17:29 +02:00
commit 624888b4e6

View file

@ -2887,20 +2887,8 @@ public:
};
struct st_lex_local: public LEX
struct st_lex_local: public LEX, public Sql_alloc
{
static void *operator new(size_t size) throw()
{
return sql_alloc(size);
}
static void *operator new(size_t size, MEM_ROOT *mem_root) throw()
{
return (void*) alloc_root(mem_root, (uint) size);
}
static void operator delete(void *ptr,size_t size)
{ TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root)
{ /* Never called */ }
};
extern void lex_init(void);