~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.h

  • Committer: Olaf van der Spek
  • Date: 2011-06-21 14:55:36 UTC
  • mto: This revision was merged to the branch mainline in revision 2346.
  • Revision ID: olafvdspek@gmail.com-20110621145536-hd50tbacow514s9s
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * @brief Memory root declarations
19
19
 */
20
20
 
21
 
 
22
 
 
23
21
#pragma once
24
22
 
25
23
#include <cstddef>
68
66
    min_malloc(0),
69
67
    block_size(0),
70
68
    block_num(0),
71
 
    first_block_usage(0),
72
 
    error_handler(0)
 
69
    first_block_usage(0)
73
70
  { }
74
71
 
75
72
  Root(size_t block_size_arg)
79
76
    block_size= block_size_arg - memory::ROOT_MIN_BLOCK_SIZE;
80
77
    block_num= 4;                       /* We shift this with >>2 */
81
78
    first_block_usage= 0;
82
 
    error_handler= 0;
83
79
  }
84
80
 
85
 
  ~Root();
86
 
 
87
81
  /**
88
82
   * blocks with free memory in it 
89
83
   */
113
107
   */
114
108
  unsigned int first_block_usage;
115
109
 
116
 
  void (*error_handler)(void);
117
110
  void reset_root_defaults(size_t block_size, size_t prealloc_size);
118
111
  void *alloc_root(size_t Size);
119
112
  inline void *allocate(size_t Size)