3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

convert mega-bytes to bytes in env_params

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2013-03-29 09:05:36 -07:00
parent 0590101e6f
commit 435c6dd365
2 changed files with 9 additions and 6 deletions

View file

@ -26,7 +26,7 @@ void env_params::updt_params() {
params_ref p = gparams::get();
set_verbosity_level(p.get_uint("verbose", get_verbosity_level()));
enable_warning_messages(p.get_bool("warning", true));
memory::set_max_size(p.get_uint("memory_max_size", 0));
memory::set_max_size(megabytes_to_bytes(p.get_uint("memory_max_size", 0)));
memory::set_high_watermark(p.get_uint("memory_high_watermark", 0));
}

View file

@ -394,11 +394,14 @@ public:
inline std::ostream & operator<<(std::ostream & out, escaped const & s) { s.display(out); return out; }
inline unsigned long long megabytes_to_bytes(unsigned b) {
if (b == UINT_MAX)
return UINT64_MAX;
else
return static_cast<unsigned long long>(b) * 1024ull * 1024ull;
inline size_t megabytes_to_bytes(unsigned mb) {
if (mb == UINT_MAX)
return SIZE_MAX;
unsigned long long b = static_cast<unsigned long long>(mb) * 1024ull * 1024ull;
size_t r = static_cast<size_t>(b);
if (r != b) // overflow
r = SIZE_MAX;
return r;
}
void z3_bound_num_procs();