mirror of
https://github.com/Z3Prover/z3
synced 2025-04-22 16:45:31 +00:00
ML API: Build system and error handling fixes.
Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
parent
fd2ae5f60e
commit
09aa02759f
3 changed files with 19 additions and 7 deletions
|
@ -135,16 +135,12 @@ struct
|
|||
let v = Z3native.mk_context_rc cfg in
|
||||
Z3native.del_config(cfg) ;
|
||||
Z3native.set_ast_print_mode v (int_of_ast_print_mode PRINT_SMTLIB2_COMPLIANT) ;
|
||||
Z3native.set_internal_error_handler v ;
|
||||
(* Printf.printf "Installing finalizer on context \n" ; *)
|
||||
let res = { m_n_ctx = v; m_n_obj_cnt = 0 } in
|
||||
let f = fun o -> dispose_context o in
|
||||
Gc.finalise f res;
|
||||
res
|
||||
(* CMW: Install error handler here!
|
||||
m_n_err_handler = new Z3native.error_handler(NativeErrorHandler); keep reference so it doesn't get collected.
|
||||
Z3native.set_error_handler(m_ctx, m_n_err_handler);
|
||||
GC.SuppressFinalize(this);
|
||||
*)
|
||||
|
||||
let context_add1 ctx = ignore (ctx.m_n_obj_cnt = ctx.m_n_obj_cnt + 1)
|
||||
let context_sub1 ctx = ignore (ctx.m_n_obj_cnt = ctx.m_n_obj_cnt - 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue