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 {
8080 m.release ();
8181 }
8282
83- Region::Pool Region::pool;
83+ Region::Pool& Region::pool (void ) {
84+ static Region::Pool _p;
85+ return _p;
86+ }
8487
8588 void *
8689 Region::heap_alloc (size_t s) {
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ namespace Gecode {
9292 ~Pool (void );
9393 };
9494 // / Just use a single static pool for heap chunks
95- GECODE_KERNEL_EXPORT static Pool pool;
95+ GECODE_KERNEL_EXPORT Pool& pool () ;
9696 // / Heap information data structure
9797 class HeapInfo {
9898 public:
@@ -348,7 +348,7 @@ namespace Gecode {
348348
349349 forceinline
350350 Region::Region (void )
351- : chunk(pool.chunk()), hi(0 ) {}
351+ : chunk(pool() .chunk()), hi(0 ) {}
352352
353353 forceinline void
354354 Region::free (void ) {
@@ -369,7 +369,7 @@ namespace Gecode {
369369
370370 forceinline
371371 Region::~Region (void ) {
372- pool.chunk (chunk);
372+ pool () .chunk (chunk);
373373 if (hi != NULL )
374374 heap_free ();
375375 }
You can’t perform that action at this time.
0 commit comments