~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/memory/hp_block.cc

  • Committer: Mark Atwood
  • Date: 2011-09-14 03:30:42 UTC
  • mfrom: (2409.2.6 refactor7)
  • Revision ID: me@mark.atwood.name-20110914033042-2u0s8foaigvf62g2
mergeĀ lp:~olafvdspek/drizzle/refactor7

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
 
127
127
unsigned char *hp_free_level(HP_BLOCK *block, uint32_t level, HP_PTRS *pos, unsigned char *last_pos)
128
128
{
129
 
  int max_pos;
130
129
  unsigned char *next_ptr;
131
130
 
132
131
  if (level == 1)
135
134
  }
136
135
  else
137
136
  {
138
 
    max_pos= (block->level_info[level-1].last_blocks == pos) ?
139
 
      HP_PTRS_IN_NOD - block->level_info[level-1].free_ptrs_in_block :
140
 
    HP_PTRS_IN_NOD;
 
137
    int max_pos= (block->level_info[level-1].last_blocks == pos) ? HP_PTRS_IN_NOD - block->level_info[level-1].free_ptrs_in_block : HP_PTRS_IN_NOD;
141
138
 
142
139
    next_ptr=(unsigned char*) (pos+1);
143
140
    for (int i= 0; i < max_pos ; i++)
147
144
 
148
145
  if ((unsigned char*) pos != last_pos)
149
146
  {
150
 
    free((unsigned char*) pos);
 
147
    free(pos);
151
148
    return last_pos;
152
149
  }
153
150
  return next_ptr;                      /* next memory position */