File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ namespace Gecode {
80
80
m.release ();
81
81
}
82
82
83
- Region::Pool Region::pool;
83
+ Region::Pool& Region::pool (void ) {
84
+ static Region::Pool _p;
85
+ return _p;
86
+ }
84
87
85
88
void *
86
89
Region::heap_alloc (size_t s) {
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ namespace Gecode {
92
92
~Pool (void );
93
93
};
94
94
// / Just use a single static pool for heap chunks
95
- GECODE_KERNEL_EXPORT static Pool pool;
95
+ GECODE_KERNEL_EXPORT Pool& pool () ;
96
96
// / Heap information data structure
97
97
class HeapInfo {
98
98
public:
@@ -348,7 +348,7 @@ namespace Gecode {
348
348
349
349
forceinline
350
350
Region::Region (void )
351
- : chunk(pool.chunk()), hi(0 ) {}
351
+ : chunk(pool() .chunk()), hi(0 ) {}
352
352
353
353
forceinline void
354
354
Region::free (void ) {
@@ -369,7 +369,7 @@ namespace Gecode {
369
369
370
370
forceinline
371
371
Region::~Region (void ) {
372
- pool.chunk (chunk);
372
+ pool () .chunk (chunk);
373
373
if (hi != NULL )
374
374
heap_free ();
375
375
}
You can’t perform that action at this time.
0 commit comments