~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.h

  • Committer: Brian Aker
  • Date: 2010-04-19 17:51:52 UTC
  • Revision ID: brian@gaz-20100419175152-lar9fncw9vhhav0d
Updates to confine memroot

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
class Root
64
64
{
65
65
public:
 
66
 
 
67
  Root() { }
 
68
  Root(size_t block_size_arg)
 
69
  {
 
70
    free= used= pre_alloc= 0;
 
71
    min_malloc= 32;
 
72
    block_size= block_size_arg - memory::ROOT_MIN_BLOCK_SIZE;
 
73
    error_handler= 0;
 
74
    block_num= 4;                       /* We shift this with >>2 */
 
75
    first_block_usage= 0;
 
76
  }
 
77
 
66
78
  /**
67
79
   * blocks with free memory in it 
68
80
   */
93
105
  unsigned int first_block_usage;
94
106
 
95
107
  void (*error_handler)(void);
 
108
  void reset_root_defaults(size_t block_size, size_t prealloc_size);
 
109
  void *alloc_root(size_t Size);
 
110
  void mark_blocks_free();
 
111
 
96
112
};
97
113
 
98
114
inline static bool alloc_root_inited(Root *root)
105
121
void *alloc_root(Root *mem_root, size_t Size);
106
122
void *multi_alloc_root(Root *mem_root, ...);
107
123
void free_root(Root *root, myf MyFLAGS);
108
 
void set_prealloc_root(Root *root, char *ptr);
109
 
void reset_root_defaults(Root *mem_root, size_t block_size,
110
 
                         size_t prealloc_size);
111
124
char *strdup_root(Root *root,const char *str);
112
125
char *strmake_root(Root *root,const char *str,size_t len);
113
126
void *memdup_root(Root *root,const void *str, size_t len);