From 58336b68a9969dc866e26e54327eb6f0b6ca6334 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 6 Mar 2009 05:49:56 +0000 Subject: [PATCH] Add a TODO note. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29412 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/messaging/MessagingService.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/system/kernel/messaging/MessagingService.cpp b/src/system/kernel/messaging/MessagingService.cpp index c0dc43ac21..8f8665641a 100644 --- a/src/system/kernel/messaging/MessagingService.cpp +++ b/src/system/kernel/messaging/MessagingService.cpp @@ -450,6 +450,14 @@ MessagingService::_AllocateCommand(int32 commandWhat, int32 size, // delete the discarded areas (save one) ObjectDeleter discardedAreaDeleter; MessagingArea *discardedArea = NULL; + // TODO: this loop still has a flaw + // - if the first area in the list is full, + // we will always allocate a new area to add the next message to, + // even if we already have another area in the chain with enough space + // if the allocation fails this probably needs to walk the list + // and keep trying for each non-empty area it finds until it either + // succeeds or hits the last area. Only in the latter case should we + // be allocating a new one. while (fFirstArea != fLastArea) { area = fFirstArea; area->Lock();