~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/memory/root.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

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