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

adpool.cpp (revision 1248)
111 111
#endif
112 112

  
113 113
/**
114
 * Description not yet available.
115
 * \param
116
 */
117
void * adpool::alloc(void)
114
Allocate memory for link*.
115
*/
116
void* adpool::alloc(void)
118 117
{
119 118
  if (!head)
120 119
  {
121 120
    grow();
122
    //cout << "depth = " << depth_check() << endl;
123 121
  }
124
  link * p = head;
122
  link* p = head;
123

  
125 124
#if defined(__CHECK_MEMORY__)
126 125
  if(bad(p))
127 126
  {
......
137 136
    }
138 137
  }
139 138
#endif
139

  
140 140
  head = p->next;
141 141
  num_allocated++;
142
  //cout << "allocating " << p << endl;
142

  
143 143
#if defined(__CHECK_MEMORY__)
144 144
  if (p == pchecker)
145 145
  {
146 146
    cout << "trying to allocate already allocated object " << endl;
147 147
  }
148 148
#endif
149

  
149 150
  ((twointsandptr*)p)->nvar=nvar;
150 151
  ((twointsandptr*)p)->ptr=this;
151 152
#if defined (INCLUDE_BLOCKSIZE)
152 153
  ((twointsandptr*)p)->blocksize=size;
153 154
#endif
154
  //cout << *(int*)p << endl;
155

  
155 156
  return p;
156 157
}
157 158

  
......
307 308
}
308 309

  
309 310
/**
310
 * Description not yet available.
311
 * \param
312
 */
311
Set size of adpool.
312

  
313
/param sz is a non-negative integer
314
*/
313 315
void adpool::set_size(unsigned int sz)
314 316
{
315
  if (sz<0)
317
  if (size !=sz && size != 0)
316 318
  {
317
    size=0;
319
    cerr << "You can not change the allocation size in mid stream\n"
320
         << " current size is " << size << " trying to change to " 
321
         << sz << '\n';
318 322
  }
319
  else if (size !=sz && size != 0)
320
  {
321
    cerr << "You can not change the allocation size in mid stream" << endl;
322
    cerr << " current size is " << size << " trying to change to " << sz
323
         << endl;
324
  }
325
  else
326
  {
327
    size=sz;
328
  }
323
  size = sz < 0 ? 0 : sz;
329 324
}
330 325

  
331

  
332
//void xxiieeuu(void * tmp0){;}
333 326
/**
334 327
 * Description not yet available.
335 328
 * \param
......
368 361

  
369 362
 const int pvalues_size=500000;
370 363
/**
371
 * Description not yet available.
372
 */
364
*/
373 365
void adpool::grow(void)
374 366
{
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff