valgrind: r3781 - trunk/coregrind

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

valgrind: r3781 - trunk/coregrind

svn-2
Author: njn
Date: 2005-05-21 20:36:45 +0100 (Sat, 21 May 2005)
New Revision: 3781

Modified:
   trunk/coregrind/m_mallocfree.c
Log:
Concise-ify switch.


Modified: trunk/coregrind/m_mallocfree.c
===================================================================
--- trunk/coregrind/m_mallocfree.c 2005-05-20 02:45:15 UTC (rev 3780)
+++ trunk/coregrind/m_mallocfree.c 2005-05-21 19:36:45 UTC (rev 3781)
@@ -533,22 +533,10 @@
 {
    vg_assert(0 == pszB % VG_MIN_MALLOC_SZB);
    pszB /= VG_MIN_MALLOC_SZB;
-   switch (pszB) {
-      case 0:  return 0;
-      case 1:  return 1;
-      case 2:  return 2;
-      case 3:  return 3;
-      case 4:  return 4;
-      case 5:  return 5;
-      case 6:  return 6;
-      case 7:  return 7;
-      case 8:  return 8;
-      case 9:  return 9;
-      case 10: return 10;
-      case 11: return 11;
-      case 12: return 12;
-      default: break;
-   }
+
+   // The first 13 lists hold blocks of size VG_MIN_MALLOC_SZB * list_num.
+   // The final 4 hold bigger blocks.
+   if (pszB <= 12)  return pszB;
    if (pszB <= 16)  return 13;
    if (pszB <= 32)  return 14;
    if (pszB <= 64)  return 15;



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
<a href="http://ads.osdn.com/?ad_idt12&alloc_id344&op=click">http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers