~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.h

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * @brief Memory root declarations
19
19
 */
20
20
 
 
21
 
 
22
 
21
23
#ifndef DRIZZLED_MEMORY_ROOT_H
22
24
#define DRIZZLED_MEMORY_ROOT_H
23
25
 
25
27
 
26
28
#include <drizzled/definitions.h>
27
29
 
 
30
#include <drizzled/visibility.h>
 
31
 
28
32
namespace drizzled
29
33
{
30
34
 
60
64
 
61
65
 
62
66
 
63
 
class Root
 
67
class DRIZZLED_API Root
64
68
{
65
69
public:
66
70
 
119
123
  void (*error_handler)(void);
120
124
  void reset_root_defaults(size_t block_size, size_t prealloc_size);
121
125
  void *alloc_root(size_t Size);
 
126
  inline void *allocate(size_t Size)
 
127
  {
 
128
    return alloc_root(Size);
 
129
  }
122
130
  void mark_blocks_free();
123
131
  void *memdup_root(const void *str, size_t len);
124
132
  char *strdup_root(const char *str);
 
133
 
125
134
  char *strmake_root(const char *str,size_t len);
126
135
  void init_alloc_root(size_t block_size= ROOT_MIN_BLOCK_SIZE);
127
136
 
 
137
  inline void *duplicate(const void *str, size_t len)
 
138
  {
 
139
    return memdup_root(str, len);
 
140
  }
 
141
 
128
142
  inline bool alloc_root_inited()
129
143
  {
130
144
    return min_malloc != 0;