MySQL  8.0.18
Source Code Documentation
my_memory.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 #ifndef COMPONENT_MEMORY_H
23 #define COMPONENT_MEMORY_H
24 
25 /**
26  @file components/library_mysys/my_memory.h
27 */
28 
30 
31 /**
32  Below functions are used by the components. And these functions will
33  be in a static library(liblibrary_mysys.a) and the library is statically
34  linked whenever any component needs these function.
35 */
36 
37 /**
38  Allocates size bytes of memory.
39 
40  @param key P_S key used for memory instrumentation
41  @param size size bytes to allocate the memory
42  @param flags used at the time of allocation
43 */
44 extern "C" void *my_malloc(PSI_memory_key key, size_t size, int flags);
45 
46 /**
47  Frees the memory pointed by the ptr.
48 
49  @param ptr memory address to be freed
50 */
51 extern "C" void my_free(void *ptr);
52 #endif // COMPONENT_MEMORY_H
Performance schema instrumentation interface.
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:46
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
static const char * key
Definition: suite_stubs.c:14
void * my_malloc(PSI_memory_key key, size_t size, int flags)
Below functions are used by the components.
Definition: my_memory.cc:57
static int flags[50]
Definition: hp_test1.cc:39