drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ut0mem.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/*******************************************************************/
25
26#pragma once
27#ifndef ut0mem_h
28#define ut0mem_h
29
30#include "univ.i"
31#include <string.h>
32#include <sys/types.h>
33#ifndef UNIV_HOTBACKUP
34# include "os0sync.h"
35
39extern ulint ut_total_allocated_memory;
40
43#endif /* !UNIV_HOTBACKUP */
44
51UNIV_INLINE
52void*
53ut_memcpy(void* dest, const void* sour, ulint n);
54
61UNIV_INLINE
62void*
63ut_memmove(void* dest, const void* sour, ulint n);
64
71UNIV_INLINE
72int
73ut_memcmp(const void* str1, const void* str2, ulint n);
74
75/**********************************************************************/
77UNIV_INTERN
78void
79ut_mem_init(void);
80/*=============*/
81
82/**********************************************************************/
86UNIV_INTERN
87void*
89/*==========*/
90 ulint n,
91 ibool set_to_zero,
94 ibool assert_on_error);
96/**********************************************************************/
100#ifdef __cplusplus
101extern "C"
102#endif
103UNIV_INTERN
104void*
106/*======*/
107 ulint n);
108#ifndef UNIV_HOTBACKUP
109/**********************************************************************/
114UNIV_INTERN
115ibool
117/*===========*/
118 ulint n);
119#endif /* !UNIV_HOTBACKUP */
120/**********************************************************************/
123#ifdef __cplusplus
124extern "C"
125#endif
126UNIV_INTERN
127void
128ut_free(
129/*====*/
130 void* ptr);
131#ifndef UNIV_HOTBACKUP
132/**********************************************************************/
157#ifdef __cplusplus
158extern "C"
159#endif
160UNIV_INTERN
161void*
163/*=======*/
164 void* ptr,
165 ulint size);
166/**********************************************************************/
168UNIV_INTERN
169void
170ut_free_all_mem(void);
171/*=================*/
172#endif /* !UNIV_HOTBACKUP */
173
178UNIV_INLINE
179char*
180ut_strcpy(char* dest, const char* sour);
181
185UNIV_INLINE
186ulint
187ut_strlen(const char* str);
188
194UNIV_INLINE
195int
196ut_strcmp(const char* str1, const char* str2);
197
198/**********************************************************************/
203UNIV_INTERN
204ulint
206/*=======*/
207 char* dst,
208 const char* src,
209 ulint size);
210
211/**********************************************************************/
215UNIV_INTERN
216ulint
218/*===========*/
219 char* dst,
220 const char* src,
221 ulint size);
222
223/**********************************************************************/
226UNIV_INLINE
227ulint
229/*=======*/
230 const char* str,
231 char q);
232
233/**********************************************************************/
238UNIV_INTERN
239char*
241/*=======*/
242 char* dest,
243 char q,
244 const char* src);
245
246/**********************************************************************/
251UNIV_INTERN
252char*
254/*=======*/
255 char* dest,
256 char q,
257 const char* src,
258 ulint len);
259
260/**********************************************************************/
264UNIV_INTERN
265ulint
267/*========*/
268 const char* s1,
269 const char* s2);
270
271/**********************************************************************/
275UNIV_INTERN
276char*
278/*==========*/
279 const char* str,
280 const char* s1,
281 const char* s2);
282
283/**********************************************************************/
289UNIV_INLINE
290ulint
292/*==========*/
293 const void* raw,
294 ulint raw_size,
295 char* hex,
296 ulint hex_size);
297
298/*******************************************************************/
304UNIV_INLINE
305ulint
307/*==============*/
308 const char* str,
309 ulint str_len,
310 char* buf,
311 ulint buf_size);
313
314#ifndef UNIV_NONINL
315#include "ut0mem.ic"
316#endif
317
318#endif
pthread_mutex_t os_fast_mutex_t
Definition os0sync.h:50
UNIV_INTERN ulint ut_strlcpy_rev(char *dst, const char *src, ulint size)
Definition ut0mem.cc:473
UNIV_INTERN ibool ut_test_malloc(ulint n)
Definition ut0mem.cc:254
UNIV_INLINE ulint ut_strlenq(const char *str, char q)
UNIV_INLINE void * ut_memcpy(void *dest, const void *sour, ulint n)
UNIV_INLINE void * ut_memmove(void *dest, const void *sour, ulint n)
UNIV_INTERN void * ut_realloc(void *ptr, ulint size)
Definition ut0mem.cc:355
UNIV_INLINE int ut_strcmp(const char *str1, const char *str2)
UNIV_INTERN void * ut_malloc_low(ulint n, ibool set_to_zero, ibool assert_on_error)
Definition ut0mem.cc:93
UNIV_INLINE ulint ut_strlen(const char *str)
UNIV_INTERN char * ut_strreplace(const char *str, const char *s1, const char *s2)
Definition ut0mem.cc:578
UNIV_INLINE int ut_memcmp(const void *str1, const void *str2, ulint n)
UNIV_INTERN char * ut_memcpyq(char *dest, char q, const char *src, ulint len)
Definition ut0mem.cc:519
UNIV_INTERN void ut_mem_init(void)
Definition ut0mem.cc:77
UNIV_INTERN void ut_free(void *ptr)
Definition ut0mem.cc:294
UNIV_INTERN char * ut_strcpyq(char *dest, char q, const char *src)
Definition ut0mem.cc:497
UNIV_INLINE ulint ut_str_sql_format(const char *str, ulint str_len, char *buf, ulint buf_size)
os_fast_mutex_t ut_list_mutex
Definition ut0mem.cc:48
UNIV_INLINE ulint ut_raw_to_hex(const void *raw, ulint raw_size, char *hex, ulint hex_size)
UNIV_INLINE char * ut_strcpy(char *dest, const char *sour)
UNIV_INTERN void ut_free_all_mem(void)
Definition ut0mem.cc:411
UNIV_INTERN ulint ut_strcount(const char *s1, const char *s2)
Definition ut0mem.cc:544
ulint ut_total_allocated_memory
Definition ut0mem.cc:45
UNIV_INTERN void * ut_malloc(ulint n)
Definition ut0mem.cc:235
UNIV_INTERN ulint ut_strlcpy(char *dst, const char *src, ulint size)
Definition ut0mem.cc:449