Commit 16bc16f9 authored by Marko Mäkelä's avatar Marko Mäkelä

Actually invoke free() in ut_allocator::deallocate().

The necessary call was inadvertently commented out in a
merge of MySQL 5.7.14 to MariaDB 10.2.1
(commit fec844ac).
parent a5d8dc18
/***************************************************************************** /*****************************************************************************
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -389,25 +390,21 @@ class ut_allocator { ...@@ -389,25 +390,21 @@ class ut_allocator {
} }
/** Free a memory allocated by allocate() and trace the deallocation. /** Free a memory allocated by allocate() and trace the deallocation.
@param[in,out] ptr pointer to memory to free @param[in,out] ptr pointer to memory to free */
@param[in] n_elements number of elements allocated (unused) */ void deallocate(pointer ptr, size_type)
void
deallocate(
pointer ptr,
size_type n_elements = 0)
{ {
#ifdef UNIV_PFS_MEMORY
if (ptr == NULL) { if (ptr == NULL) {
return; return;
} }
#ifdef UNIV_PFS_MEMORY
ut_new_pfx_t* pfx = reinterpret_cast<ut_new_pfx_t*>(ptr) - 1; ut_new_pfx_t* pfx = reinterpret_cast<ut_new_pfx_t*>(ptr) - 1;
deallocate_trace(pfx); deallocate_trace(pfx);
free(pfx); free(pfx);
#else #else
// free(ptr); free(ptr);
#endif /* UNIV_PFS_MEMORY */ #endif /* UNIV_PFS_MEMORY */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment