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 Without limiting anything contained in the foregoing, this file, 15 which is part of C Driver for MySQL (Connector/C), is also subject to the 16 Universal FOSS Exception, version 1.0, a copy of which can be found at 17 http://oss.oracle.com/licenses/universal-foss-exception. 18 19 This program is distributed in the hope that it will be useful, 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 GNU General Public License, version 2.0, for more details. 23 24 You should have received a copy of the GNU General Public License 25 along with this program; if not, write to the Free Software 26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ 27 28 #ifndef THR_MALLOC_INCLUDED 29 #define THR_MALLOC_INCLUDED 30 31 #include "my_global.h" 32 33 typedef struct charset_info_st CHARSET_INFO; 34 typedef struct st_mem_root MEM_ROOT; 35 typedef unsigned int PSI_memory_key; 36 37 void init_sql_alloc(PSI_memory_key key, 38 MEM_ROOT *root, size_t block_size, size_t pre_alloc_size); 39 40 void *sql_alloc(size_t); 41 void *sql_calloc(size_t); 42 char *sql_strdup(const char *str); 43 char *sql_strmake(const char *str, size_t len); 44 void *sql_memdup(const void * ptr, size_t size); 45 char *sql_strmake_with_convert(const char *str, size_t arg_length, 46 const CHARSET_INFO *from_cs, 47 size_t max_res_length, 48 const CHARSET_INFO *to_cs, size_t *result_length); 49 50 #endif /* THR_MALLOC_INCLUDED */ 51