dont remember
[vg.git] / src / vg / vg_profiler.h
index 6c9530c07dc36cc7ce298aa9313136a4598d9275..fdd26a7101bfca4b57d45bb8b8ce5df08a84a7b9 100644 (file)
@@ -1,7 +1,6 @@
 #ifndef VG_PROFILER_H
 #define VG_PROFILER_H
 
-#include <alloca.h>
 #include "vg_platform.h"
 
 #define VG_PROFILE_SAMPLE_COUNT 128
@@ -77,8 +76,11 @@ static void vg_profile_drawn( struct vg_profile **profiles, u32 count,
    float sh = panel[3] / VG_PROFILE_SAMPLE_COUNT,
          sw = panel[2];
 
-   float *avgs = alloca( count * sizeof(float) );
-   int   *ptrs = alloca( count * sizeof(int) );
+   ui_fill_rect( &ui_global_ctx, panel, 0xa0000000 );
+
+   assert( count <= 8 );
+   float avgs[8];
+   int   ptrs[8];
 
    for( int i=0; i<count; i++ )
    {
@@ -101,8 +103,8 @@ static void vg_profile_drawn( struct vg_profile **profiles, u32 count,
             ptrs[j] = VG_PROFILE_SAMPLE_COUNT-1;
 
          float sample  = profiles[j]->samples[ptrs[j]],
-               px      = (total  / (budget*0.25f)) * sw,
-               wx      = (sample / (budget*0.25f)) * sw;
+               px      = (total  / (budget)) * sw,
+               wx      = (sample / (budget)) * sw;
 
          ui_rect block = { panel[0] + px, panel[1] + (float)i*sh,
                            wx,            sh };