[haiku-commits] r42340 - haiku/trunk/src/system/kernel

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Jun 2011 20:03:43 +0200 (CEST)

Author: mmlr
Date: 2011-06-29 20:03:42 +0200 (Wed, 29 Jun 2011)
New Revision: 42340
Changeset: https://dev.haiku-os.org/changeset/42340

Modified:
   haiku/trunk/src/system/kernel/port.cpp
Log:
Optimize the configuration of the port heap. Previously the max bin size was
512 bytes with a heap page of 2048 bytes resulting in excessive waste for
allocations between 512 and 1023 bytes. Also tune the requested alignment so
that sizeof(port_message) (currently 28 bytes) can occupy one allocation unit
without waste.


Modified: haiku/trunk/src/system/kernel/port.cpp
===================================================================
--- haiku/trunk/src/system/kernel/port.cpp      2011-06-28 23:48:00 UTC (rev 
42339)
+++ haiku/trunk/src/system/kernel/port.cpp      2011-06-29 18:03:42 UTC (rev 
42340)
@@ -760,9 +760,9 @@
                return B_ERROR;
        }
 
-       static const heap_class kBufferHeapClass = {"default", 100,
+       static const heap_class kBufferHeapClass = { "port heap", 100,
                PORT_MAX_MESSAGE_SIZE + sizeof(port_message), 2 * 1024,
-               sizeof(port_message), 8, 4, 64};
+               sizeof(port_message), 4, 2, 24 };
        sPortAllocator = heap_create_allocator("port buffer", base,
                kInitialPortBufferSize, &kBufferHeapClass, true);
        if (sPortAllocator == NULL) {


Other related posts:

  • » [haiku-commits] r42340 - haiku/trunk/src/system/kernel - mmlr