Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/hp2graph/sample.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "hp2graph.h"

int samplesize = 0;
Sample *sampledata = 0;

static int samplemax = 32;

void addSample(int census,double t)
{
  if(!sampledata || samplesize == samplemax) {
    samplemax *= 2;
    if(!(sampledata = (Sample *)extend(sampledata, samplemax*sizeof(Sample)))){
      fprintf(stderr,"Out of memory when allocating memory for SAMPLE at %d\n",lexline);
      abort();
    }
  }
  if (timebyallocation)
       sampledata[samplesize++] = census;
  else sampledata[samplesize++] = t;
}




Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.