3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-27 10:55:50 +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

@ -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();