fix tbb leaks
This commit is contained in:
		
							parent
							
								
									d473acb56d
								
							
						
					
					
						commit
						e8cca36369
					
				@ -58,7 +58,7 @@ matrix:
 | 
				
			|||||||
        apt:
 | 
					        apt:
 | 
				
			||||||
          sources: ['ubuntu-toolchain-r-test']
 | 
					          sources: ['ubuntu-toolchain-r-test']
 | 
				
			||||||
          packages: ['libstdc++-5-dev']
 | 
					          packages: ['libstdc++-5-dev']
 | 
				
			||||||
      env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_SANITIZER=ON
 | 
					      env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Release Builds
 | 
					    # Release Builds
 | 
				
			||||||
    - os: linux
 | 
					    - os: linux
 | 
				
			||||||
 | 
				
			|||||||
@ -3,10 +3,12 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "util/log.hpp"
 | 
					#include "util/log.hpp"
 | 
				
			||||||
#include "util/meminfo.hpp"
 | 
					#include "util/meminfo.hpp"
 | 
				
			||||||
 | 
					#include "util/timing_util.hpp"
 | 
				
			||||||
#include "util/version.hpp"
 | 
					#include "util/version.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <tbb/task_scheduler_init.h>
 | 
					#include <tbb/task_scheduler_init.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <boost/assert.hpp>
 | 
				
			||||||
#include <boost/filesystem.hpp>
 | 
					#include <boost/filesystem.hpp>
 | 
				
			||||||
#include <boost/program_options.hpp>
 | 
					#include <boost/program_options.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -154,8 +156,13 @@ int main(int argc, char *argv[]) try
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    tbb::task_scheduler_init init(partition_config.requested_num_threads);
 | 
					    tbb::task_scheduler_init init(partition_config.requested_num_threads);
 | 
				
			||||||
 | 
					    BOOST_ASSERT(init.is_active());
 | 
				
			||||||
 | 
					    util::Log() << "Computing recursive bisection";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    TIMER_START(bisect);
 | 
				
			||||||
    auto exitcode = partition::Partitioner().Run(partition_config);
 | 
					    auto exitcode = partition::Partitioner().Run(partition_config);
 | 
				
			||||||
 | 
					    TIMER_STOP(bisect);
 | 
				
			||||||
 | 
					    util::Log() << "Bisection took " << TIMER_SEC(bisect) << " seconds.";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    util::DumpMemoryStats();
 | 
					    util::DumpMemoryStats();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -8,6 +8,10 @@
 | 
				
			|||||||
#include <boost/test/test_case_template.hpp>
 | 
					#include <boost/test/test_case_template.hpp>
 | 
				
			||||||
#include <boost/test/unit_test.hpp>
 | 
					#include <boost/test/unit_test.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// make sure not to leak in recursive bisection
 | 
				
			||||||
 | 
					#include <tbb/task_scheduler_init.h>
 | 
				
			||||||
 | 
					tbb::task_scheduler_init init(2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
using namespace osrm::partition;
 | 
					using namespace osrm::partition;
 | 
				
			||||||
using namespace osrm::util;
 | 
					using namespace osrm::util;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user