comparison Histogram.c @ 27:75df4e468930

rearrange to work with autoconf
author Nina Engelhardt <nengel@mailbox.tu-berlin.de>
date Tue, 25 Sep 2012 16:04:31 +0200
parents 7664da1180fd
children 2aa025da7c60
comparison
equal deleted inserted replaced
18:8bc11786d9d1 19:7b7b9c9b3dd7
91 makeHist_helper( hist, numBins, startOfRange, binWidth, strdup(name)); 91 makeHist_helper( hist, numBins, startOfRange, binWidth, strdup(name));
92 92
93 return hist; 93 return hist;
94 } 94 }
95 95
96 void inline 96 void
97 addToHist( int32 value, Histogram *hist ) 97 addToHist( int32 value, Histogram *hist )
98 { 98 {
99 int32 binIdx; 99 int32 binIdx;
100 100
101 if( value < hist->startOfRange ) 101 if( value < hist->startOfRange )
110 } 110 }
111 111
112 hist->bins[ binIdx ] += 1; 112 hist->bins[ binIdx ] += 1;
113 } 113 }
114 114
115 void inline 115 void
116 subFromHist( int32 value, Histogram *hist ) 116 subFromHist( int32 value, Histogram *hist )
117 { 117 {
118 int32 binIdx; 118 int32 binIdx;
119 119
120 if( value < hist->startOfRange ) 120 if( value < hist->startOfRange )
132 } 132 }
133 133
134 134
135 /*Inline because use with RDTSC in innermost code so need ultra-fast 135 /*Inline because use with RDTSC in innermost code so need ultra-fast
136 */ 136 */
137 void inline 137 void
138 addIntervalToHist( uint32 startIntvl, uint32 endIntvl, Histogram *hist ) 138 addIntervalToHist( uint32 startIntvl, uint32 endIntvl, Histogram *hist )
139 { 139 {
140 int32 value; 140 int32 value;
141 141
142 value = endIntvl - startIntvl; 142 value = endIntvl - startIntvl;
143 if( value < 0 || value > 10000000 ) return; //sanity check 143 if( value < 0 || value > 10000000 ) return; //sanity check
144 addToHist( value, hist ); 144 addToHist( value, hist );
145 } 145 }
146 146
147 void inline 147 void
148 subIntervalFromHist( int32 startIntvl, int32 endIntvl, Histogram *hist ) 148 subIntervalFromHist( int32 startIntvl, int32 endIntvl, Histogram *hist )
149 { 149 {
150 int32 value; 150 int32 value;
151 151
152 value = endIntvl - startIntvl; 152 value = endIntvl - startIntvl;