summaryrefslogtreecommitdiff
path: root/storage/innobase/include/ut0new.h
diff options
context:
space:
mode:
authorDaniel Black <daniel@linux.ibm.com>2019-03-07 18:39:20 +1100
committerDaniel Black <daniel@linux.ibm.com>2019-03-16 11:04:19 +1100
commita9056a2b89280c1f2272759b56b70eebe4a00fb3 (patch)
tree47d977aebf0208bffd7f9408c825085d9727b621 /storage/innobase/include/ut0new.h
parent8678a1052d5d4c2f2c7ac7f9ae4dff0c3030824b (diff)
downloadmariadb-git-a9056a2b89280c1f2272759b56b70eebe4a00fb3.tar.gz
MDEV-18946: innodb: {de|}allocate_large_{dodump|dontdump} added
In 1dc78d35a0beb9620bae1f4841cc07389b425707 the arguments to a deallocate_large(dontdump=true) was passed a wrong value. To avoid accidential calling large memory function that have DODUMP/DONTDUMP options and missing arguments, the functions have been given distinct names.
Diffstat (limited to 'storage/innobase/include/ut0new.h')
-rw-r--r--storage/innobase/include/ut0new.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/storage/innobase/include/ut0new.h b/storage/innobase/include/ut0new.h
index b79d03f1b0b..117913c9b71 100644
--- a/storage/innobase/include/ut0new.h
+++ b/storage/innobase/include/ut0new.h
@@ -654,13 +654,18 @@ public:
return(ptr);
}
+ pointer
+ allocate_large_dontdump(
+ size_type n_elements,
+ ut_new_pfx_t* pfx)
+ {
+ return allocate_large(n_elements, pfx, true);
+ }
/** Free a memory allocated by allocate_large() and trace the
deallocation.
@param[in,out] ptr pointer to memory to free
@param[in] pfx descriptor of the memory, as returned by
- allocate_large().
- @param[in] dodump if true, advise the OS to include this
- memory again if a core dump occurs. */
+ allocate_large(). */
void
deallocate_large(
pointer ptr,
@@ -669,12 +674,8 @@ public:
pfx
#endif
,
- size_t size,
- bool dodump = false)
+ size_t size)
{
- if (dodump) {
- ut_dodump(ptr, size);
- }
#ifdef UNIV_PFS_MEMORY
if (pfx) {
deallocate_trace(pfx);
@@ -684,8 +685,27 @@ public:
os_mem_free_large(ptr, size);
}
+ void
+ deallocate_large_dodump(
+ pointer ptr,
+ const ut_new_pfx_t*
#ifdef UNIV_PFS_MEMORY
+ pfx
+#endif
+ ,
+ size_t size)
+ {
+ ut_dodump(ptr, size);
+ deallocate_large(ptr,
+#ifdef UNIV_PFS_MEMORY
+ pfx,
+#else
+ NULL,
+#endif
+ size);
+ }
+#ifdef UNIV_PFS_MEMORY
/** Get the performance schema key to use for tracing allocations.
@param[in] file file name of the caller or NULL if unknown
@return performance schema key */