Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Histogram
diff Histogram.c @ 15:32489b8b763c
added MC_shared brch
| author | Me@portablequad |
|---|---|
| date | Sat, 11 Feb 2012 19:20:37 -0800 |
| parents | 1fbaedaac2c7 |
| children | f4d96eaf374a |
line diff
1.1 --- a/Histogram.c Sat Feb 11 19:19:06 2012 -0800 1.2 +++ b/Histogram.c Sat Feb 11 19:20:37 2012 -0800 1.3 @@ -35,8 +35,8 @@ 1.4 int32 i; 1.5 1.6 1.7 - hist = malloc( sizeof(Histogram) ); 1.8 - hist->bins = malloc( numBins * sizeof(int32) ); 1.9 + hist = VMS__malloc( sizeof(Histogram) ); 1.10 + hist->bins = VMS__malloc( numBins * sizeof(int32) ); 1.11 1.12 hist->numBins = numBins; 1.13 hist->binWidth = (endOfRange - startOfRange) / numBins; 1.14 @@ -72,16 +72,16 @@ 1.15 { 1.16 Histogram *hist; 1.17 1.18 - hist = malloc( sizeof(Histogram) ); 1.19 - hist->bins = malloc( numBins * sizeof(int32) ); 1.20 + hist = VMS__malloc( sizeof(Histogram) ); 1.21 + hist->bins = VMS__malloc( numBins * sizeof(int32) ); 1.22 1.23 - makeHist_helper( hist, numBins, startOfRange, binWidth,strDup(name)); 1.24 + makeHist_helper( hist, numBins, startOfRange, binWidth,VMS__strDup(name)); 1.25 1.26 return hist; 1.27 } 1.28 1.29 Histogram * 1.30 -makeFixedBinHist( int32 numBins, int32 startOfRange, int32 binWidth, 1.31 +makeFixedBinHistExt( int32 numBins, int32 startOfRange, int32 binWidth, 1.32 char *name ) 1.33 1.34 { 1.35 @@ -346,6 +346,13 @@ 1.36 void 1.37 freeHist( Histogram *hist ) 1.38 { 1.39 + VMS__free( hist->bins ); 1.40 + VMS__free( hist->name ); 1.41 + VMS__free( hist ); 1.42 + } 1.43 +void 1.44 +freeHistExt( Histogram *hist ) 1.45 + { 1.46 free( hist->bins ); 1.47 free( hist->name ); 1.48 free( hist );
