mirror of
https://github.com/MariaDB/server.git
synced 2026-04-19 06:45:32 +02:00
cleanup: inherit from Sql_alloc
instead of copy-pasting its methods into a new class
This commit is contained in:
parent
43d1f0b6b9
commit
624888b4e6
1 changed files with 1 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue