summaryrefslogtreecommitdiff
path: root/lib/freebl/mpi
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2016-06-06 17:43:18 +0200
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2016-06-06 17:43:18 +0200
commitc13901fcb4ae47bb519751796784f83aaaf4d5a6 (patch)
tree39cbe131ea87c367f9af09453ce738f1abd0b644 /lib/freebl/mpi
parent1b8752894d5896fc077b4f5d7a05efdc1cb3d9ac (diff)
downloadnss-hg-c13901fcb4ae47bb519751796784f83aaaf4d5a6.tar.gz
Bug 1278237 - remove unused variables, r=ttaubert
Diffstat (limited to 'lib/freebl/mpi')
-rw-r--r--lib/freebl/mpi/mdxptest.c8
-rw-r--r--lib/freebl/mpi/mpi-priv.h4
-rw-r--r--lib/freebl/mpi/mpi.c8
3 files changed, 0 insertions, 20 deletions
diff --git a/lib/freebl/mpi/mdxptest.c b/lib/freebl/mpi/mdxptest.c
index 28b05f046..3f8db4ce6 100644
--- a/lib/freebl/mpi/mdxptest.c
+++ b/lib/freebl/mpi/mdxptest.c
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <malloc.h>
#include <time.h>
#include "mpi.h"
#include "mpi-priv.h"
@@ -267,30 +266,24 @@ main(int argc, char **argv)
testNewFuncs( default_n+2, modulus_len - 2);
testNewFuncs( default_n+3, modulus_len - 3);
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
rv = testModExp(default_n, 0, buf, buf2, modulus_len);
dumpBytes((unsigned char *)buf2, modulus_len);
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
rv = testModExp(default_n, 1, buf, buf2, modulus_len);
dumpBytes((unsigned char *)buf2, modulus_len);
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
rv = testModExp(default_n, 2, buf, buf2, modulus_len);
dumpBytes((unsigned char *)buf2, modulus_len);
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
rv = testModExp(default_n, 3, buf, buf2, modulus_len);
dumpBytes((unsigned char *)buf2, modulus_len);
}
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
rv = doModExp(default_n, default_d, buf, buf2, modulus_len);
if (rv != 0) {
fprintf(stderr, "Error in modexp operation:\n");
exit(1);
}
dumpBytes((unsigned char *)buf2, modulus_len);
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
timeCtx = CreateTimingContext();
TimingBegin(timeCtx);
@@ -304,7 +297,6 @@ main(int argc, char **argv)
}
TimingEnd(timeCtx);
printf("%ld iterations in %s\n", iters, TimingGenerateString(timeCtx));
- printf("%lu allocations, %lu frees, %lu copies\n", mp_allocs, mp_frees, mp_copies);
return 0;
}
diff --git a/lib/freebl/mpi/mpi-priv.h b/lib/freebl/mpi/mpi-priv.h
index 1fd628a8d..b00e54e88 100644
--- a/lib/freebl/mpi/mpi-priv.h
+++ b/lib/freebl/mpi/mpi-priv.h
@@ -100,10 +100,6 @@ void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count); /* copy */
void *s_mp_alloc(size_t nb, size_t ni); /* general allocator */
void s_mp_free(void *ptr); /* general free function */
-extern unsigned long mp_allocs;
-extern unsigned long mp_frees;
-extern unsigned long mp_copies;
-
mp_err s_mp_grow(mp_int *mp, mp_size min); /* increase allocated size */
mp_err s_mp_pad(mp_int *mp, mp_size min); /* left pad with zeroes */
diff --git a/lib/freebl/mpi/mpi.c b/lib/freebl/mpi/mpi.c
index 37847ec20..3a49390f2 100644
--- a/lib/freebl/mpi/mpi.c
+++ b/lib/freebl/mpi/mpi.c
@@ -62,10 +62,6 @@ static const char *s_dmap_1 =
/* }}} */
-unsigned long mp_allocs;
-unsigned long mp_frees;
-unsigned long mp_copies;
-
/* {{{ Default precision manipulation */
/* Default precision for newly created mp_int's */
@@ -2809,8 +2805,6 @@ inline void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count)
#else
memcpy(dp, sp, count * sizeof(mp_digit));
#endif
- ++mp_copies;
-
} /* end s_mp_copy() */
/* }}} */
@@ -2820,7 +2814,6 @@ inline void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count)
/* Allocate ni records of nb bytes each, and return a pointer to that */
inline void *s_mp_alloc(size_t nb, size_t ni)
{
- ++mp_allocs;
return calloc(nb, ni);
} /* end s_mp_alloc() */
@@ -2833,7 +2826,6 @@ inline void *s_mp_alloc(size_t nb, size_t ni)
inline void s_mp_free(void *ptr)
{
if(ptr) {
- ++mp_frees;
free(ptr);
}
} /* end s_mp_free() */