Skip to content

Commit 3108773

Browse files
osander1awalther1
authored andcommitted
Always assume ADOLC_USE_CALLOC
Without that flag the code doesn't even compile anymore.
1 parent 56b2f4b commit 3108773

File tree

5 files changed

+0
-36
lines changed

5 files changed

+0
-36
lines changed

ADOL-C/doc/adolc-manual.tex

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -968,12 +968,6 @@ \subsection{Customizing ADOL-C}
968968
undefined) by passing \texttt{--enable-atrig-erf}
969969
to \texttt{./configure}
970970

971-
\item[{\sf ADOLC\_USE\_CALLOC}{\rm :}] Selects the memory allocation routine
972-
used by ADOL-C. {\sf Malloc} will be used if this variable is
973-
undefined. {\sf ADOLC\_USE\_CALLOC} is defined by default to avoid incorrect
974-
result caused by uninitialized memory. It can be set undefined by
975-
passing \texttt{--disable-use-calloc} to \texttt{./configure}.
976-
977971
\item[{\sf ADOLC\_ADVANCED\_BRANCHING}{\rm :}] Enables routines
978972
required for automatic branch selection (default: disabled). The
979973
boolean valued comparison operators with two \texttt{adouble} type

ADOL-C/src/adalloc.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,11 @@
2121
#else
2222
# define ADOLC_CALLOC(n,m) rpl_calloc(n,m)
2323
#endif
24-
#if defined(ADOLC_USE_CALLOC)
2524
# if !defined(ADOLC_NO_MALLOC)
2625
# define ADOLC_MALLOC(n,m) calloc(n,m)
2726
# else
2827
# define ADOLC_MALLOC(n,m) rpl_calloc(n,m)
2928
# endif
30-
#else
31-
# if !defined(ADOLC_NO_MALLOC)
32-
# define ADOLC_MALLOC(n,m) malloc(n*m)
33-
# else
34-
# define ADOLC_MALLOC(n,m) rpl_malloc(n*m)
35-
# endif
36-
#endif
3729

3830
BEGIN_C_DECLS
3931

ADOL-C/src/drivers/psdrivers.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ int directional_active_gradient(short tag, /* trace identifier */
123123
gradu = (double**)myalloc2(s,n);
124124
E = (double**)myalloc2(n,n);
125125

126-
#if !defined(ADOLC_USE_CALLOC)
127-
memset(&(E[0][0]), 0, n*n*sizeof(double));
128-
#endif
129-
130126
max_dk=0;
131127
max_entry = -1;
132128
for(i=0;i<n;i++){

ADOL-C/src/fo_rev.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,12 +489,6 @@ int int_reverse_safe(
489489
sizeof(revreal));
490490
if (rp_T == NULL) fail(ADOLC_MALLOC_FAILED);
491491
ADOLC_CURRENT_TAPE_INFOS.workMode = ADOLC_FOV_REVERSE;
492-
#if !defined(ADOLC_USE_CALLOC)
493-
c_Ptr = (char *) ADOLC_GLOBAL_TAPE_VARS.dpp_A;
494-
*c_Ptr = 0;
495-
memcpy(c_Ptr + 1, c_Ptr, sizeof(double) * p *
496-
ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] - 1);
497-
#endif
498492
# define ADJOINT_BUFFER rpp_A
499493
# define ADJOINT_BUFFER_ARG_L rpp_A[arg][l]
500494
# define ADJOINT_BUFFER_RES_L rpp_A[res][l]

configure.ac

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,6 @@ if test x$ac_cv_func_malloc_0_nonnull != xyes ; then
154154
AC_DEFINE_UNQUOTED([calloc],[rpl_calloc],[Define to rpl_calloc if the replacement function should be used.])
155155
fi
156156

157-
AC_MSG_CHECKING(whether to use calloc or malloc for memory allocation)
158-
AC_ARG_ENABLE(use-calloc,[AS_HELP_STRING([--disable-use-calloc],
159-
[disable use of calloc and use malloc instead for memory allocation [default=calloc is used]])],
160-
[use_calloc=$enableval],[use_calloc=yes])
161-
162-
if test x$use_calloc = xyes ; then
163-
AC_MSG_RESULT(calloc)
164-
AC_DEFINE(ADOLC_USE_CALLOC,1,[Use calloc instead of malloc for memory allocation])
165-
else
166-
AC_MSG_RESULT(malloc)
167-
fi
168-
169157
AC_MSG_CHECKING(whether to use 32-bit or 64-bit locations)
170158
AC_ARG_ENABLE(ulong,[AS_HELP_STRING([--enable-ulong],
171159
[enable 64-bit locations (only available on 64-bit systems) [default=32-bit]])],

0 commit comments

Comments
 (0)