Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <ian.jauslin@roma1.infn.it>2016-05-20 21:41:54 +0000
committerIan Jauslin <ian.jauslin@roma1.infn.it>2016-05-20 21:41:54 +0000
commit46cae873fa2bd7973aa2e98d5955d2287822c604 (patch)
treee5b254c772210d6910c7b8fa4dbbdaa9a9400a12 /src/integral_base.c
parent2125f01f97abfe343fc5e0cc078bf1d081b2e441 (diff)
Array: add array_alloc_tmps_*HEADv1.0.1master
Diffstat (limited to 'src/integral_base.c')
-rw-r--r--src/integral_base.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/integral_base.c b/src/integral_base.c
index da3f05a..e743191 100644
--- a/src/integral_base.c
+++ b/src/integral_base.c
@@ -254,16 +254,8 @@ int INTEGRAL_FUNC(integrate_gauss_smarttmp) (INTEGRAL_FLOAT_TYPE* out, int (*fun
return(LIBINUM_ERROR_SIZE_MISMATCH);
}
- // allocate tmps if needed
- if(tmps->memory<4){
- // no need to resize since the values should not be kept
- INTEGRAL_FLOATARRAY_FUNC(free)(*tmps);
- INTEGRAL_FLOATARRAY_FUNC(init)(tmps, 4);
- }
- for (i=tmps->length;i<4;i++){
- INTEGRAL_FLOAT_INIT(tmps->values[i]);
- (tmps->length)++;
- }
+ // allocate tmp values if needed
+ INTEGRAL_FLOATARRAY_FUNC(alloc_tmps)(4, tmps);
// init to 0
INTEGRAL_FLOAT_SET_UI(*out, 0);