IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 27, 2016, 11:18:36 AM (10 years ago)
Author:
eugene
Message:

trying to catch memory corruption by being extra pedantic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libfits/table/F_uncompress_T.c

    r38553 r39324  
    88int gfits_distribute_table_gzp2 (FTable *table, TableField *field, char *raw, int row_start, int Nrows);
    99
     10# define OHANA_MEMCHECK 0
    1011# define VERBOSE_DUMP 0
    1112
     
    164165  gettimeofday (&startTimer, (void *) NULL);
    165166
    166   // this allocates the pointer data array for the full set of tiles (NOT the heap)
    167   char *tmpbuffer = NULL;
    168   ALLOCATE_ZERO (tmpbuffer, char, max_width*Ny);
     167  if (OHANA_MEMCHECK) ohana_memcheck (TRUE);
     168
     169  // this allocates the pointer data array for the full set of tiles (NOT the heap) by
     170  // calling with an empty data array, data values are not actually copied (this is done
     171  // below after decompression)
    169172  for (i = 0; i < Nfields; i++) {
    170     if (!gfits_set_bintable_column (tgtheader, tgttable, fields[i].ttype, tmpbuffer, Ny)) ESCAPE;
    171   }
    172   free (tmpbuffer);
     173    if (!gfits_set_bintable_column (tgtheader, tgttable, fields[i].ttype, NULL, Ny)) ESCAPE;
     174  }
    173175   
     176  if (OHANA_MEMCHECK) ohana_memcheck (TRUE);
     177
    174178  int Ntile = srcheader->Naxis[1];
    175179  int ztilelast;
Note: See TracChangeset for help on using the changeset viewer.