trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sureshsubbiah <...@git.apache.org>
Subject [GitHub] trafodion pull request #1404: Trafodion 2916
Date Sat, 20 Jan 2018 17:52:18 GMT
Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1404#discussion_r162788763
  
    --- Diff: core/conn/odb/src/odb.c ---
    @@ -7080,7 +7080,7 @@ static void Oload(int eid)
                 mfl = (size_t) etab[eid].td[i].Osize;
     
         /* Allocate field buffer */
    -    if ( (str = (char *)malloc (mfl + 128)) == (void *)NULL ) {
    +    if ( (str = (char *)calloc (1, etab[eid].buffsz + 1)) == (void *)NULL ) {
    --- End diff --
    
    Is the buffer str used to read in source data for string column and reused for the next
row/column? I am anxious that we do not do this large allocation repeatedly. I feel this is
addressed already, the question is more of a sanity check as I cannot trace the variable str
back far enough.


---

Mime
View raw message