added performance improvement in find_slots routine to skip full bit map words in...
authorDavid Lide <a0216552@gtudci01.(none)>
Tue, 3 May 2016 14:54:30 +0000 (10:54 -0400)
committerDavid Lide <a0216552@gtudci01.(none)>
Tue, 3 May 2016 14:54:30 +0000 (10:54 -0400)
ti/runtime/hplib/src/bm_alloc.c

index 5e1763397d94731cdef5ded34343ad025cd89caf..c79efc58d1c83849937bf542a263ad90657048fb 100755 (executable)
@@ -137,6 +137,7 @@ static int inline bmFindSlots(BM_MALLOC_STATE_T *p, uint32_t size)
     if ((szinpages * p->PSZ) < size) szinpages+=1;
     for(i=0,c=0;i<p->NPAGES/(8*sizeof(uint32_t)) && (c< szinpages) ;)
     {
+        if ((!flag) && (*pW == 0xffffffff)) {pW+=1;i+=1;continue;}
         for(j=0;j<(8*sizeof(uint32_t));j++)
         {
             if (!flag)
@@ -149,7 +150,7 @@ static int inline bmFindSlots(BM_MALLOC_STATE_T *p, uint32_t size)
             }
             else
             {
-                if (c==szinpages) continue; //skipping rest of inner loop
+                if (c==szinpages) break; //skipping rest of inner loop
                 if(*pW & (1<<(31-j)) )
                 {
                     //not large enough