~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/heap.h

  • Committer: Monty Taylor
  • Date: 2008-12-04 01:52:59 UTC
  • mto: This revision was merged to the branch mainline in revision 649.
  • Revision ID: monty@inaugust.com-20081204015259-b90660chfn9unkg1
Removed some my_malloc calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
{
62
62
  /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */
63
63
  uint32_t free_ptrs_in_block;
64
 
 
 
64
  
65
65
  /*
66
66
    Maximum number of records that can be 'contained' inside of each element
67
 
    of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for
 
67
    of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for 
68
68
    level 2 - HP_PTRS_IN_NOD^2 and so forth.
69
69
  */
70
70
  uint32_t records_under_level;
71
71
 
72
72
  /*
73
 
    Ptr to last allocated HP_PTRS (or records buffer for level 0) on this
 
73
    Ptr to last allocated HP_PTRS (or records buffer for level 0) on this 
74
74
    level.
75
75
  */
76
 
  HP_PTRS *last_blocks;
 
76
  HP_PTRS *last_blocks;                 
77
77
};
78
78
 
79
79
 
83
83
  is recbuffer bytes.
84
84
  The internal representation is as follows:
85
85
  HP_BLOCK is a hierarchical structure of 'blocks'.
86
 
  A block at level 0 is an array records_in_block records.
87
 
  A block at higher level is an HP_PTRS structure with pointers to blocks at
 
86
  A block at level 0 is an array records_in_block records. 
 
87
  A block at higher level is an HP_PTRS structure with pointers to blocks at 
88
88
  lower levels.
89
89
  At the highest level there is one top block. It is stored in HP_BLOCK::root.
90
90
 
91
 
  See hp_find_block for a description of how record pointer is obtained from
 
91
  See hp_find_block for a description of how record pointer is obtained from 
92
92
  its index.
93
 
  See hp_get_new_block
 
93
  See hp_get_new_block 
94
94
*/
95
95
 
96
96
typedef struct st_heap_block
97
97
{
98
 
  HP_PTRS *root;                        /* Top-level block */
 
98
  HP_PTRS *root;                        /* Top-level block */ 
99
99
  struct st_level_info level_info[HP_MAX_LEVELS+1];
100
100
  uint32_t levels;                          /* number of used levels */
101
101
  uint32_t records_in_block;            /* Records in one heap-block */
117
117
    Number of buckets used in hash table. Used only to provide
118
118
    #records estimates for heap key scans.
119
119
  */
120
 
  ha_rows hash_buckets;
 
120
  ha_rows hash_buckets; 
121
121
  TREE rb_tree;
122
122
  int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo,
123
123
                   const unsigned char *record, unsigned char *recpos);
135
135
  uint16_t null_pos;                    /* position for null marker */
136
136
  uint8_t  length_bytes;  /* length of the size, 1 o 2 bytes */
137
137
} HP_COLUMNDEF;
138
 
 
 
138
 
139
139
typedef struct st_heap_dataspace   /* control data for data space */
140
140
{
141
141
  HP_BLOCK block;
170
170
  uint32_t currently_disabled_keys;    /* saved value from "keys" when disabled */
171
171
  uint32_t open_count;
172
172
 
173
 
 
 
173
  
174
174
  char * name;                  /* Name of "memory-file" */
175
175
  THR_LOCK lock;
176
176
  pthread_mutex_t intern_lock;          /* Locking for use with _locking */
209
209
  uint32_t auto_key;                        /* keynr [1 - maxkey] for auto key */
210
210
  uint32_t auto_key_type;
211
211
  uint32_t max_chunk_size;
212
 
  uint32_t is_dynamic;
 
212
  uint32_t is_dynamic;  
213
213
  uint64_t max_table_size;
214
214
  uint64_t auto_increment;
215
215
  bool with_auto_increment;