summaryrefslogtreecommitdiff
path: root/sql/sql_list.h
diff options
context:
space:
mode:
authorserg@serg.mylan <>2004-01-30 08:09:42 +0100
committerserg@serg.mylan <>2004-01-30 08:09:42 +0100
commit4e4d618683ccee1301b6c2116ecb0a9dbab10a8d (patch)
treecb98eb7653a3fa063a2efd6abfb7c179c7a07caa /sql/sql_list.h
parentf0f9e0d7d70f74588cfb11512ee76d7be402f2bf (diff)
downloadmariadb-git-4e4d618683ccee1301b6c2116ecb0a9dbab10a8d.tar.gz
catch accesses to deleted objects
double delete bug fixed
Diffstat (limited to 'sql/sql_list.h')
-rw-r--r--sql/sql_list.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 0972d0341f6..c7faef88358 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -21,6 +21,12 @@
/* mysql standard class memoryallocator */
+#ifdef PEDANTIC_SAFEMALLOC
+#define TRASH(XX,YY) bfill((XX), (YY), 0x8F)
+#else
+#define TRASH(XX,YY) /* no-op */
+#endif
+
class Sql_alloc
{
public:
@@ -34,8 +40,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) {} /*lint -e715 */
- static void operator delete[](void *ptr, size_t size) {}
+ static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); }
+ static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); }
#ifdef HAVE_purify
bool dummy;
inline Sql_alloc() :dummy(0) {}