diff FloatHist.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 06128e387cfa
children 83a412f2ef98
line diff
     1.1 --- a/FloatHist.c	Sat Oct 30 22:13:09 2010 -0700
     1.2 +++ b/FloatHist.c	Sun Oct 31 20:22:29 2010 -0700
     1.3 @@ -7,8 +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, the starting
    1.11   * value, and the width of each bin, as a float, all chosen at creation.
    1.12 @@ -28,8 +26,8 @@
    1.13     FloatHist *hist;
    1.14     int i;
    1.15  
    1.16 -   hist = malloc( sizeof(FloatHist) );
    1.17 -   hist->bins = malloc( numBins * sizeof(int) );
    1.18 +   hist = VMS__malloc( sizeof(FloatHist) );
    1.19 +   hist->bins = VMS__malloc( numBins * sizeof(int) );
    1.20  
    1.21     hist->numBins      = numBins;
    1.22     hist->binWidth     = binWidth;
    1.23 @@ -98,3 +96,10 @@
    1.24      }
    1.25   }
    1.26  
    1.27 +
    1.28 +void
    1.29 +freeDblHist( FloatHist *hist )
    1.30 + {
    1.31 +   VMS__free( hist->bins );
    1.32 +   VMS__free( hist );
    1.33 + }