~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.cc

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
257
257
  return((void*) start);
258
258
}
259
259
 
260
 
static void trash_mem(memory::internal::UsedMemory *)
261
 
{
262
 
  TRASH(((char*)(x) + (x->size - x->left)), x->left);
263
 
}
 
260
#define TRASH_MEM(X) TRASH(((char*)(X) + ((X)->size-(X)->left)), (X)->left)
264
261
 
265
262
/**
266
263
 * @brief
276
273
  for (next= free; next; next= *(last= &next->next))
277
274
  {
278
275
    next->left= next->size - ALIGN_SIZE(sizeof(memory::internal::UsedMemory));
279
 
    trash_mem(next);
 
276
    TRASH_MEM(next);
280
277
  }
281
278
 
282
279
  /* Combine the free and the used list */
286
283
  for (; next; next= next->next)
287
284
  {
288
285
    next->left= next->size - ALIGN_SIZE(sizeof(memory::internal::UsedMemory));
289
 
    trash_mem(next);
 
286
    TRASH_MEM(next);
290
287
  }
291
288
 
292
289
  /* Now everything is set; Indicate that nothing is used anymore */
339
336
  {
340
337
    this->free=this->pre_alloc;
341
338
    this->free->left=this->pre_alloc->size-ALIGN_SIZE(sizeof(memory::internal::UsedMemory));
342
 
    trash_mem(this->pre_alloc);
 
339
    TRASH_MEM(this->pre_alloc);
343
340
    this->free->next=0;
344
341
  }
345
342
  this->block_num= 4;