Changeset 444


Ignore:
Timestamp:
Dec 28, 2013 11:39:08 AM (7 years ago)
Author:
kulshres
Message:

One really must calloc the adjoints

Random values at the start do no good to anyone. The strange use of
ADOLC_USE_CALLOC define here was not being invoked because we normally
do define it.

Signed-off-by: Kshitij Kulshreshtha <kshitij@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ADOL-C/src/fo_rev.c

    r442 r444  
    344344#endif
    345345
    346 #if !defined(ADOLC_USE_CALLOC)
    347     char * c_Ptr;
    348 #endif
    349 
    350346    /****************************************************************************/
    351347    /*                                          extern diff. function variables */
     
    448444    /*--------------------------------------------------------------------------*/
    449445#ifdef _FOS_                                                         /* FOS */
    450     rp_A = (revreal*) malloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] * sizeof(revreal));
     446    rp_A = (revreal*) calloc(ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES], sizeof(revreal));
    451447    if (rp_A == NULL) fail(ADOLC_MALLOC_FAILED);
    452448    ADOLC_CURRENT_TAPE_INFOS.rp_A = rp_A;
     
    454450            sizeof(revreal));
    455451    if (rp_T == NULL) fail(ADOLC_MALLOC_FAILED);
    456 #if !defined(ADOLC_USE_CALLOC)
    457     c_Ptr = (char *) ADOLC_GLOBAL_TAPE_VARS.rp_A;
    458     *c_Ptr = 0;
    459     memcpy(c_Ptr + 1, c_Ptr, sizeof(double) *
    460             ADOLC_CURRENT_TAPE_INFOS.stats[NUM_MAX_LIVES] - 1);
    461 #endif
    462452#ifdef _ABS_NORM_
    463453    memset(results,0,sizeof(double)*(indep+swchk));
Note: See TracChangeset for help on using the changeset viewer.