~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 14:35:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622143511-bqcqg1tho8v0fn0d
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 * chunk for memory allocation and pre-allocates first block if specified.
46
46
 * Altough error can happen during execution of this function if
47
47
 * pre_alloc_size is non-0 it won't be reported. Instead it will be
48
 
 * reported as error in first alloc_root() on this memory root.
 
48
 * reported as error in first alloc() on this memory root.
49
49
 *
50
50
 * @param  mem_root       memory root to initialize
51
51
 * @param  block_size     size of chunks (blocks) used for memory allocation
137
137
 * @todo Would this be more suitable as a member function on the
138
138
 * Root class?
139
139
 */
140
 
void* Root::alloc(size_t length)
 
140
unsigned char* Root::alloc(size_t length)
141
141
{
142
142
  internal::UsedMemory *next= NULL;
143
143
  assert(alloc_root_inited());
209
209
 * A pointer to the beginning of the allocated memory block in case of 
210
210
 * success or NULL if out of memory
211
211
 */
212
 
void* Root::multi_alloc_root(int unused, ...)
 
212
void* Root::multi_alloc(int unused, ...)
213
213
{
214
214
  va_list args;
215
215
  char* *ptr, *start, *res;
225
225
  }
226
226
  va_end(args);
227
227
 
228
 
  start= (char*) this->alloc_root(tot_length);
 
228
  start= (char*) this->alloc(tot_length);
229
229
 
230
230
  va_start(args, unused);
231
231
  res= start;