Fix signatures of placement operator delete in places where placement

delete is declared. As we don't use exceptions placement delete is never 
called and the fix only affects numerous warnings when
compiling with MS Visual C++.
For more info see http://www.gotw.ca/gotw/010.htm.
This commit is contained in:
konstantin@mysql.com 2005-02-15 03:55:44 +03:00
parent c30f7feba1
commit f7512e756f
5 changed files with 7 additions and 5 deletions

View file

@ -119,7 +119,7 @@ public:
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr,size_t size) {}
static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {}
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
enum Type {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM,
INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM,

View file

@ -707,6 +707,8 @@ struct Item_change_record: public ilink
Item *old_value;
/* Placement new was hidden by `new' in ilink (TODO: check): */
static void *operator new(size_t size, void *mem) { return mem; }
static void operator delete(void *ptr, size_t size) {}
static void operator delete(void *ptr, void *mem) { /* never called */ }
};

View file

@ -241,7 +241,7 @@ public:
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr,size_t size) {}
static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {}
static void operator delete(void *ptr, MEM_ROOT *mem_root) {}
st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {}
virtual ~st_select_lex_node() {}
inline st_select_lex_node* get_master() { return master; }

View file

@ -41,8 +41,8 @@ public:
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ 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, size_t size, MEM_ROOT *mem_root)
{ TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root)
{ /* never called */ }
static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); }
#ifdef HAVE_purify
bool dummy;

View file

@ -73,7 +73,7 @@ public:
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr_arg,size_t size)
{}
static void operator delete(void *ptr_arg,size_t size, MEM_ROOT *mem_root)
static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
{}
~String() { free(); }