mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 21:01:22 +00:00
add new C API function: Z3_finalize_memory()
Useful to debug memory leaks in Z3 and in client applications Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
This commit is contained in:
parent
6217804ed5
commit
0997d0d2b5
2 changed files with 18 additions and 1 deletions
|
@ -516,6 +516,11 @@ extern "C" {
|
||||||
memory::initialize(0);
|
memory::initialize(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Z3_API Z3_finalize_memory(void) {
|
||||||
|
LOG_Z3_finalize_memory();
|
||||||
|
memory::finalize();
|
||||||
|
}
|
||||||
|
|
||||||
Z3_error_code Z3_API Z3_get_error_code(Z3_context c) {
|
Z3_error_code Z3_API Z3_get_error_code(Z3_context c) {
|
||||||
LOG_Z3_get_error_code(c);
|
LOG_Z3_get_error_code(c);
|
||||||
return mk_c(c)->get_error_code();
|
return mk_c(c)->get_error_code();
|
||||||
|
|
|
@ -5365,7 +5365,19 @@ END_MLAPI_EXCLUDE
|
||||||
*/
|
*/
|
||||||
void Z3_API Z3_reset_memory(void);
|
void Z3_API Z3_reset_memory(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CorML3
|
||||||
|
/**
|
||||||
|
\brief Destroy all allocated resources.
|
||||||
|
|
||||||
|
Any pointers previously returned by the API become invalid.
|
||||||
|
Can be used for memory leak detection.
|
||||||
|
|
||||||
|
def_API('Z3_finalize_memory', VOID, ())
|
||||||
|
*/
|
||||||
|
void Z3_API Z3_finalize_memory(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
#ifdef CorML3
|
#ifdef CorML3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue