Revision 1176 branches/threaded2merge/src/linad99/dfpool.cpp

dfpool.cpp (revision 1176)
19 19
  pthread_mutex_t mutex_dfpool = PTHREAD_MUTEX_INITIALIZER;
20 20
#endif
21 21

  
22
  void my_do_nothing(void * t){}
23
//ofstream xofs("allocation");
24 22
__thread vector_shape_pool* vector_shape::xpool = 0;
25 23
__thread vector_shape_pool* vector_shapex::xpool = 0;
26 24
__thread vector_shape_pool* arr_link::xpool = 0;
......
49 47
 * Description not yet available.
50 48
 * \param
51 49
 */
52
void * vector_shape::operator new(size_t n)
50
void* vector_shape::operator new(size_t n)
53 51
{
54 52
  if (xpool==0)
55 53
  {
......
58 56
# if defined(SAFE_ALL)
59 57
  if (n != xpool->size)
60 58
  {
59
    cerr << __FILE__ << ':' << __LINE__ << endl;
61 60
    cerr << "incorrect size requested in dfpool" << endl;
62 61
    ad_exit(1);
63 62
  }
......
69 68
 * Description not yet available.
70 69
 * \param
71 70
 */
72
void * arr_link::operator new(size_t n)
71
void* arr_link::operator new(size_t n)
73 72
{
74
  if (xpool==0)
73
  if (xpool == 0)
75 74
  {
76
    xpool=new vector_shape_pool(sizeof(vector_shape));
75
    xpool=new vector_shape_pool(sizeof(arr_link));
77 76
  }
78 77
# if defined(SAFE_ALL)
79 78
  if (n != xpool->size)
80 79
  {
81
    cerr << "incorrect size requested in dfpool" << endl;
80
    cerr << __FILE__ << ':' << __LINE__ << endl;
81
    cerr << xpool->size << endl;
82
    cerr << "incorrect size \"" << n << "\" requested in dfpool" << endl;
82 83
    ad_exit(1);
83 84
  }
84 85
# endif
......
89 90
 * Description not yet available.
90 91
 * \param
91 92
 */
92
void * vector_shapex::operator new(size_t n)
93
void* vector_shapex::operator new(size_t n)
93 94
{
94 95
  if (xpool==0)
95 96
  {
......
98 99
# if defined(SAFE_ALL)
99 100
  if (n != xpool->size)
100 101
  {
102
    cerr << __FILE__ << ':' << __LINE__ << endl;
101 103
    cerr << "incorrect size requested in dfpool" << endl;
102 104
    ad_exit(1);
103 105
  }
......
357 359
 * Description not yet available.
358 360
 * \param
359 361
 */
360
void tsdfpool::free(void * b)
362
void tsdfpool::free(void* b)
361 363
{
362 364
#if defined(SAFE_ALL)
363 365
#endif
......
386 388
#endif
387 389

  
388 390
/**
389
 * Description not yet available.
390
 * \param
391
 */
391
Destructor
392
*/
392 393
dfpool::~dfpool(void)
393 394
{
394 395
  deallocate();
395 396
}
396 397

  
397 398
/**
398
 * Description not yet available.
399
 * \param
399
Constructor
400
\param unsigned sz
400 401
 */
401
dfpool::dfpool(unsigned sz) : size(sz<sizeof(link *)?sizeof(link*):sz)
402
dfpool::dfpool(unsigned sz): size(sz < sizeof(link*) ? sizeof(link*) : sz)
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff