diff Histogram.c @ 3:3d35477a5121

This branch has replace malloc and free with VMS__malloc and VMS__free
author Me
date Sun, 31 Oct 2010 20:22:29 -0700
parents 6e864a0cb520
children 83a412f2ef98
line diff
     1.1 --- a/Histogram.c	Sat Oct 30 22:13:09 2010 -0700
     1.2 +++ b/Histogram.c	Sun Oct 31 20:22:29 2010 -0700
     1.3 @@ -7,7 +7,6 @@
     1.4   */
     1.5  
     1.6  #include "Histogram.h"
     1.7 -#include <malloc.h>
     1.8  
     1.9  
    1.10  /*This Histogram Abstract Data Type has a number of bins plus a range of
    1.11 @@ -28,8 +27,8 @@
    1.12     Histogram *hist;
    1.13     int i;
    1.14  
    1.15 -   hist = malloc( sizeof(Histogram) );
    1.16 -   hist->bins = malloc( numBins * sizeof(int) );
    1.17 +   hist = VMS__malloc( sizeof(Histogram) );
    1.18 +   hist->bins = VMS__malloc( numBins * sizeof(int) );
    1.19  
    1.20     hist->numBins      = numBins;
    1.21     hist->binWidth     = (endOfRange - startOfRange) / numBins;
    1.22 @@ -93,3 +92,9 @@
    1.23      }
    1.24   }
    1.25  
    1.26 +void
    1.27 +freeHist( Histogram *hist )
    1.28 + {
    1.29 +   VMS__free( hist->bins );
    1.30 +   VMS__free( hist );
    1.31 + }