~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.cc

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
          prev= &mem->next;
116
116
      }
117
117
      /* Allocate new prealloc block and add it to the end of free list */
118
 
      if ((mem= static_cast<memory::internal::UsedMemory *>(malloc(size))))
119
 
      {
120
 
        mem->size= size;
121
 
        mem->left= pre_alloc_size;
122
 
        mem->next= *prev;
123
 
        *prev= pre_alloc= mem;
124
 
      }
125
 
      else
126
 
      {
127
 
        pre_alloc= 0;
128
 
      }
 
118
      mem= static_cast<memory::internal::UsedMemory *>(malloc(size));
 
119
      mem->size= size;
 
120
      mem->left= pre_alloc_size;
 
121
      mem->next= *prev;
 
122
      *prev= pre_alloc= mem;
129
123
    }
130
124
  }
131
125
  else
179
173
    get_size= length+ALIGN_SIZE(sizeof(memory::internal::UsedMemory));
180
174
    get_size= max(get_size, tmp_block_size);
181
175
 
182
 
    if (!(next = static_cast<memory::internal::UsedMemory *>(malloc(get_size))))
183
 
    {
184
 
      if (this->error_handler)
185
 
        (*this->error_handler)();
186
 
      return NULL;
187
 
    }
 
176
    next = static_cast<memory::internal::UsedMemory *>(malloc(get_size));
188
177
    this->block_num++;
189
178
    next->next= *prev;
190
179
    next->size= get_size;