MySQL  8.0.27
Source Code Documentation
thr_malloc.h
Go to the documentation of this file.
1 /* Copyright (c) 2006, 2021, Oracle and/or its affiliates.
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 
23 #ifndef THR_MALLOC_INCLUDED
24 #define THR_MALLOC_INCLUDED
25 
26 #include <stddef.h>
27 
28 struct CHARSET_INFO;
29 struct MEM_ROOT;
30 typedef unsigned int PSI_memory_key;
31 extern thread_local MEM_ROOT **THR_MALLOC;
32 
33 void init_sql_alloc(PSI_memory_key key, MEM_ROOT *root, size_t block_size,
34  size_t pre_alloc_size);
35 
36 void *sql_calloc(size_t);
37 char *sql_strdup(const char *str);
38 char *sql_strmake(const char *str, size_t len);
39 void *sql_memdup(const void *ptr, size_t size);
40 char *sql_strmake_with_convert(const char *str, size_t arg_length,
41  const CHARSET_INFO *from_cs,
42  size_t max_res_length, const CHARSET_INFO *to_cs,
43  size_t *result_length);
44 
45 #endif /* THR_MALLOC_INCLUDED */
unsigned int PSI_memory_key
Instrumented memory key.
Definition: psi_memory_bits.h:48
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1056
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Definition: m_ctype.h:354
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:78
void * sql_calloc(size_t)
Definition: thr_malloc.cc:51
thread_local MEM_ROOT ** THR_MALLOC
Definition: mysqld.cc:1527
void * sql_memdup(const void *ptr, size_t size)
Definition: thr_malloc.cc:73
char * sql_strmake_with_convert(const char *str, size_t arg_length, const CHARSET_INFO *from_cs, size_t max_res_length, const CHARSET_INFO *to_cs, size_t *result_length)
Definition: thr_malloc.cc:79
unsigned int PSI_memory_key
Definition: thr_malloc.h:29
void init_sql_alloc(PSI_memory_key key, MEM_ROOT *root, size_t block_size, size_t pre_alloc_size)
Definition: thr_malloc.cc:45
char * sql_strmake(const char *str, size_t len)
Definition: thr_malloc.cc:64
char * sql_strdup(const char *str)
Definition: thr_malloc.cc:57