mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Handle failures from malloc
Most "new" failures fixed in the following files: - sql_select.cc - item.cc - item_func.cc - opt_subselect.cc Other things: - Allocate udf_handler strings in mem_root - Required changes in sql_string.h - Add mem_root as argument to some new [] calls - Mark udf_handler strings as thread specific - Removed some comment blocks with code
This commit is contained in:
@@ -181,6 +181,8 @@ public:
|
||||
}
|
||||
static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
|
||||
{ return (void*) alloc_root(mem_root, (uint) size); }
|
||||
static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
|
||||
{ return alloc_root(mem_root, size); }
|
||||
static void operator delete(void *ptr_arg, size_t size)
|
||||
{
|
||||
(void) ptr_arg;
|
||||
@@ -189,6 +191,10 @@ public:
|
||||
}
|
||||
static void operator delete(void *, MEM_ROOT *)
|
||||
{ /* never called */ }
|
||||
static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); }
|
||||
static void operator delete[](void *ptr, MEM_ROOT *mem_root)
|
||||
{ /* never called */ }
|
||||
|
||||
~String() { free(); }
|
||||
|
||||
/* Mark variable thread specific it it's not allocated already */
|
||||
|
Reference in New Issue
Block a user