summaryrefslogtreecommitdiff
path: root/tune
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2003-12-09 21:15:18 +0100
committerKevin Ryde <user42@zip.com.au>2003-12-09 21:15:18 +0100
commit4582fb2fae83ee6dd9ab4da652da8ed9834e86c2 (patch)
tree9019648eb5cdcc23a3ec960e716c441a89ca9947 /tune
parenta91d014b9776c40c45c9e46af3a1eb1430c2fd5d (diff)
downloadgmp-4582fb2fae83ee6dd9ab4da652da8ed9834e86c2.tar.gz
* tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter rather than returning a value, avoids alloca in a function call.
Diffstat (limited to 'tune')
-rw-r--r--tune/speed-ext.c4
-rw-r--r--tune/tuneup.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/tune/speed-ext.c b/tune/speed-ext.c
index b06c519ee..53e4fa14e 100644
--- a/tune/speed-ext.c
+++ b/tune/speed-ext.c
@@ -1,6 +1,6 @@
/* An example of extending the speed program to measure routines not in GMP.
-Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -187,7 +187,7 @@ mean_open2 (mp_ptr wp, mp_srcptr xp, mp_srcptr yp, mp_size_t size)
SPEED_RESTRICT_COND (s->size >= 1); \
\
TMP_MARK (marker); \
- wp = SPEED_TMP_ALLOC_LIMBS (s->size, s->align_wp); \
+ SPEED_TMP_ALLOC_LIMBS (wp, s->size, s->align_wp); \
\
speed_operand_src (s, s->xp, s->size); \
speed_operand_src (s, s->yp, s->size); \
diff --git a/tune/tuneup.c b/tune/tuneup.c
index 6c8eff510..5bc4bced5 100644
--- a/tune/tuneup.c
+++ b/tune/tuneup.c
@@ -355,8 +355,8 @@ tuneup_measure (speed_function_t fun,
s->size += param->size_extra;
TMP_MARK (marker);
- s->xp = SPEED_TMP_ALLOC_LIMBS (s->size, 0);
- s->yp = SPEED_TMP_ALLOC_LIMBS (s->size, 0);
+ SPEED_TMP_ALLOC_LIMBS (s->xp, s->size, 0);
+ SPEED_TMP_ALLOC_LIMBS (s->yp, s->size, 0);
mpn_random (s->xp, s->size);
mpn_random (s->yp, s->size);
@@ -1608,8 +1608,8 @@ all (void)
TMP_DECL (marker);
TMP_MARK (marker);
- s.xp_block = SPEED_TMP_ALLOC_LIMBS (SPEED_BLOCK_SIZE, 0);
- s.yp_block = SPEED_TMP_ALLOC_LIMBS (SPEED_BLOCK_SIZE, 0);
+ SPEED_TMP_ALLOC_LIMBS (s.xp_block, SPEED_BLOCK_SIZE, 0);
+ SPEED_TMP_ALLOC_LIMBS (s.yp_block, SPEED_BLOCK_SIZE, 0);
mpn_random (s.xp_block, SPEED_BLOCK_SIZE);
mpn_random (s.yp_block, SPEED_BLOCK_SIZE);