drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ha0storage.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 2007, 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/**************************************************/
27
28#pragma once
29#ifndef ha0storage_h
30#define ha0storage_h
31
32#include "univ.i"
33
36#define HA_STORAGE_DEFAULT_HEAP_BYTES 1024
37
40#define HA_STORAGE_DEFAULT_HASH_CELLS 4096
41
43typedef struct ha_storage_struct ha_storage_t;
44
45/*******************************************************************/
49UNIV_INLINE
52/*==============*/
53 ulint initial_heap_bytes,
54 ulint initial_hash_cells);
56
57/*******************************************************************/
67UNIV_INTERN
68const void*
70/*==================*/
71 ha_storage_t* storage,
72 const void* data,
73 ulint data_len,
74 ulint memlim);
75
76/*******************************************************************/
82#define ha_storage_put(storage, data, data_len) \
83 ha_storage_put_memlim((storage), (data), (data_len), 0)
84
85/*******************************************************************/
92#define ha_storage_put_str(storage, str) \
93 ((const char*) ha_storage_put((storage), (str), strlen(str) + 1))
94
95/*******************************************************************/
104#define ha_storage_put_str_memlim(storage, str, memlim) \
105 ((const char*) ha_storage_put_memlim((storage), (str), \
106 strlen(str) + 1, (memlim)))
107
108/*******************************************************************/
112UNIV_INLINE
113void
115/*=============*/
116 ha_storage_t** storage);
117
118/*******************************************************************/
122UNIV_INLINE
123void
125/*============*/
126 ha_storage_t* storage);
127
128/*******************************************************************/
131UNIV_INLINE
132ulint
134/*================*/
135 const ha_storage_t* storage);
136
137#ifndef UNIV_NONINL
138#include "ha0storage.ic"
139#endif
140
141#endif /* ha0storage_h */
UNIV_INLINE ulint ha_storage_get_size(const ha_storage_t *storage)
UNIV_INLINE ha_storage_t * ha_storage_create(ulint initial_heap_bytes, ulint initial_hash_cells)
UNIV_INLINE void ha_storage_free(ha_storage_t *storage)
UNIV_INLINE void ha_storage_empty(ha_storage_t **storage)
UNIV_INTERN const void * ha_storage_put_memlim(ha_storage_t *storage, const void *data, ulint data_len, ulint memlim)
Definition ha0storage.cc:90
struct ha_storage_struct ha_storage_t
Definition ha0storage.h:43