From ea55bd495fd0853199362563226678daf7e8ddaa Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Mon, 1 Feb 2016 17:19:55 +0000 Subject: [PATCH] add new API function Z3_get_estimated_alloc_size() that returns *estimated* allocated memory size by Z3 Signed-off-by: Nuno Lopes --- src/api/api_stats.cpp | 4 ++++ src/api/z3_api.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/api/api_stats.cpp b/src/api/api_stats.cpp index ee391f14a..a6569e878 100644 --- a/src/api/api_stats.cpp +++ b/src/api/api_stats.cpp @@ -130,4 +130,8 @@ extern "C" { Z3_CATCH_RETURN(0.0); } + unsigned long long Z3_API Z3_get_estimated_alloc_size(void) { + return memory::get_allocation_size(); + } + }; diff --git a/src/api/z3_api.h b/src/api/z3_api.h index 78506e414..f8cc2d64e 100644 --- a/src/api/z3_api.h +++ b/src/api/z3_api.h @@ -5967,6 +5967,13 @@ extern "C" { */ double Z3_API Z3_stats_get_double_value(Z3_context c, Z3_stats s, unsigned idx); + /** + \brief Return the estimated allocated memory in bytes. + + def_API('Z3_get_estimated_alloc_size', ULLONG, ()) + */ + unsigned long long Z3_API Z3_get_estimated_alloc_size(void); + /*@}*/ #ifdef __cplusplus