Drizzled Public API Documentation

sql_alloc.cc
1 /* Copyright (C) 2000-2001, 2003-2004 MySQL AB
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 as published by
5  the Free Software Foundation; version 2 of the License.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program; if not, write to the Free Software
14  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15 
16 
17 /* Mallocs for used in threads */
18 
19 #include <config.h>
20 
21 #include <string.h>
22 
23 #include <drizzled/errmsg_print.h>
24 #include <drizzled/memory/sql_alloc.h>
25 #include <drizzled/current_session.h>
26 #include <drizzled/error.h>
27 #include <drizzled/definitions.h>
28 #include <drizzled/internal/my_sys.h>
29 
30 namespace drizzled {
31 namespace memory {
32 
33 void* sql_alloc(size_t Size)
34 {
35  return current_mem_root()->alloc(Size);
36 }
37 
38 void* sql_calloc(size_t size)
39 {
40  return current_mem_root()->calloc(size);
41 }
42 
43 char* sql_strdup(const char* str)
44 {
45  return current_mem_root()->strdup(str);
46 }
47 
48 char* sql_strdup(str_ref str)
49 {
50  return current_mem_root()->strdup(str);
51 }
52 
53 void* sql_memdup(const void* ptr, size_t len)
54 {
55  return current_mem_root()->memdup(ptr, len);
56 }
57 
58 }
59 } /* namespace drizzled */