diff options
Diffstat (limited to 'storage/perfschema/pfs_global.cc')
-rw-r--r-- | storage/perfschema/pfs_global.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc index cac7d0b06e7..fa57f335325 100644 --- a/storage/perfschema/pfs_global.cc +++ b/storage/perfschema/pfs_global.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -10,8 +10,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ /** @file storage/perfschema/pfs_global.cc @@ -26,6 +26,7 @@ #include <string.h> bool pfs_initialized= false; +ulonglong pfs_allocated_memory= 0; /** Memory allocation for the performance schema. @@ -38,7 +39,9 @@ void *pfs_malloc(size_t size, myf flags) DBUG_ASSERT(size > 0); void *ptr= malloc(size); - if (ptr && (flags & MY_ZEROFILL)) + if (likely(ptr != NULL)) + pfs_allocated_memory+= size; + if (likely((ptr != NULL) && (flags & MY_ZEROFILL))) memset(ptr, 0, size); return ptr; } |