Revision 1110 trunk/src/df1b2-separable/adpool.cpp

adpool.cpp (revision 1110)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
/**
8 8
 * \file
......
83 83
    depth++;
84 84
    if (p == ptr)
85 85
    {
86
      cerr << "both allocated and unallocated memory at entry " 
86
      cerr << "both allocated and unallocated memory at entry "
87 87
           << depth << endl;
88 88
      break;
89 89
    }
......
116 116
 */
117 117
void * adpool::alloc(void)
118 118
{
119
  if (!head) 
119
  if (!head)
120 120
  {
121 121
    grow();
122 122
    //cout << "depth = " << depth_check() << endl;
......
240 240
     {
241 241
       cout << "trying to deallocate allocated object " << endl;
242 242
     }
243
   }  
243
   }
244 244
#endif
245 245
  //cout << "freeing " << b << endl;
246 246
  link * p = (link*) b;
......
283 283
 * Description not yet available.
284 284
 * \param
285 285
 */
286
adpool::adpool(void) 
286
adpool::adpool(void)
287 287
{
288 288
  num_adpools++;
289 289
  int i1=sizeof(twointsandptr);
290 290
  int i2=2*sizeof(double);
291
  if (i1>i2) 
291
  if (i1>i2)
292 292
  {
293 293
    cout << "Error because sizeof(twointsandptr)>2*sizeof(double)" << endl;
294 294
    ad_exit(1);
......
403 403
    maxaddress[num_chunks]=(real_start+chunk_size-1);
404 404
  }
405 405
#endif
406
  if (last_chunk == 0 ) 
406
  if (last_chunk == 0 )
407 407
  {
408 408
    last_chunk=real_start;
409 409
    *(char**) real_start=0;
......
413 413
    *(char**) real_start=last_chunk;
414 414
    last_chunk=real_start;
415 415
  }
416
  
416

  
417 417
#if defined(__CHECK_MEMORY__)
418 418
  if (nalloc>pvalues_size-1)
419 419
  {
......
447 447
         << " you must set the unit size " << endl;
448 448
  }
449 449
  //const int overhead = 12;
450
  
450

  
451 451
  double *ptr=first;
452 452
  for (int i=1;i<=nelem;i++)
453 453
  {

Also available in: Unified diff