29
#include <stdlib.h> // setenv();
30
#include <boost/filesystem.hpp>
32
// make the "tcmalloc: large alloc" messages from TCMallom disappear
33
// by setting the reporting environment variable to a very large value
34
// see: http://groups.google.com/group/google-perftools/browse_thread/thread/24a003fc35f3d470?pli=1
35
void quietenTCMALLOC()
37
setenv("TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD",
38
"1099511627776", // 1 TiB, should be enough to quieten almost everything
39
0); // "0" means "do not overwrite if already existing"
43
On some systems, Boost::filesystem (at least up to 1.50) throws a standard
44
exception when using some functions: locale::facet::_S_create_c_locale name not valid
45
Only countermeasure possible: setenv
46
Using setlocale or std::locale::global does *NOT* work as workaround (tried and tested)
52
boost::filesystem::path fp = boost::filesystem::current_path();
55
// if not, we're on a system with quirks
60
std::cout << "Your system seems to be older or have some quirks with locale settings."
61
"\nUsing the LC_ALL=C workaround."
62
"\nIf you don't want that, fix your system ;-)\n";
29
void quietenTCMALLOC();
30
void fixLocaleQuirk();