aboutsummaryrefslogtreecommitdiffstats
path: root/mpfr.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-07-31 20:29:38 +0300
committerArnold D. Robbins <arnold@skeeve.com>2014-07-31 20:29:38 +0300
commitd60fb05cc5db4f1ee1176a9ed7f053011f8521aa (patch)
tree2471e5d7757a3aad0f9fbf6722964a30ae1b01ee /mpfr.c
parentcafa8fcd5a5d593f4638b199fbf5f94a006a4aac (diff)
parent54146e27c8fd7756a944d0e168aa969624567b55 (diff)
downloadegawk-d60fb05cc5db4f1ee1176a9ed7f053011f8521aa.tar.gz
egawk-d60fb05cc5db4f1ee1176a9ed7f053011f8521aa.tar.bz2
egawk-d60fb05cc5db4f1ee1176a9ed7f053011f8521aa.zip
Merge branch 'master' into comment
Diffstat (limited to 'mpfr.c')
-rw-r--r--mpfr.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mpfr.c b/mpfr.c
index e9c9d154..52247978 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -89,6 +89,15 @@ init_mpfr(mpfr_prec_t prec, const char *rmode)
register_exec_hook(mpg_interpret, 0);
}
+/* cleanup_mpfr --- clean stuff up, mainly for valgrind */
+
+void
+cleanup_mpfr(void)
+{
+ mpfr_clear(_mpf_t1);
+ mpfr_clear(_mpf_t2);
+}
+
/* mpg_node --- allocate a node to store MPFR float or GMP integer */
NODE *
@@ -1239,6 +1248,8 @@ do_mpfr_div(int nargs)
mpz_tdiv_qr(quotient->mpg_i, remainder->mpg_i, num->mpg_i, denom->mpg_i);
unref(num);
unref(denom);
+ unref(numerator);
+ unref(denominator);
sub = make_string("quotient", 8);
lhs = assoc_lookup(result, sub);