[Gmp-commit] /var/hg/gmp: 2 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Sun Mar 15 13:31:16 CET 2026
details: /var/hg/gmp/rev/9914a94dc6ae
changeset: 18499:9914a94dc6ae
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Mar 15 13:23:22 2026 +0100
description:
mini-gmp/tests: New hex_random_clear function, to free all allocated blocks.
details: /var/hg/gmp/rev/6cc661f5e7ff
changeset: 18500:6cc661f5e7ff
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sun Mar 15 13:29:47 2026 +0100
description:
ChangeLog
diffstat:
mini-gmp/ChangeLog | 6 ++++++
mini-gmp/tests/hex-random.c | 6 ++++++
mini-gmp/tests/hex-random.h | 1 +
mini-gmp/tests/testutils.c | 2 ++
4 files changed, 15 insertions(+), 0 deletions(-)
diffs (52 lines):
diff -r bd3da14bae9f -r 6cc661f5e7ff mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog Mon Mar 02 08:09:06 2026 +0100
+++ b/mini-gmp/ChangeLog Sun Mar 15 13:29:47 2026 +0100
@@ -1,3 +1,9 @@
+2026-03-15 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tests/hex-random.c (hex_random_clear): New function.
+ * tests/hex-random.h: Add declaration of hex_random_clear.
+ * tests/testutils.c (main): Free memory with hex_random_clear.
+
2025-09-24 Niels Möller <nisse at lysator.liu.se>
* mini-gmp.c (MINI_GMP_ENABLE_FLOAT): New knob, to disable
diff -r bd3da14bae9f -r 6cc661f5e7ff mini-gmp/tests/hex-random.c
--- a/mini-gmp/tests/hex-random.c Mon Mar 02 08:09:06 2026 +0100
+++ b/mini-gmp/tests/hex-random.c Sun Mar 15 13:29:47 2026 +0100
@@ -116,6 +116,12 @@
mpz_clear (seed);
}
+void
+hex_random_clear (void)
+{
+ gmp_randclear (state);
+}
+
char *
hex_urandomb (unsigned long bits)
{
diff -r bd3da14bae9f -r 6cc661f5e7ff mini-gmp/tests/hex-random.h
--- a/mini-gmp/tests/hex-random.h Mon Mar 02 08:09:06 2026 +0100
+++ b/mini-gmp/tests/hex-random.h Sun Mar 15 13:29:47 2026 +0100
@@ -30,6 +30,7 @@
};
void hex_random_init (void);
+void hex_random_clear (void);
char *hex_urandomb (unsigned long bits);
char *hex_rrandomb (unsigned long bits);
char *hex_rrandomb_export (void *dst, size_t *countp,
diff -r bd3da14bae9f -r 6cc661f5e7ff mini-gmp/tests/testutils.c
--- a/mini-gmp/tests/testutils.c Mon Mar 02 08:09:06 2026 +0100
+++ b/mini-gmp/tests/testutils.c Sun Mar 15 13:29:47 2026 +0100
@@ -143,6 +143,8 @@
(unsigned long) total_alloc);
abort ();
}
+
+ hex_random_clear ();
return 0;
}
More information about the gmp-commit
mailing list