Hi Guys,

        Here is a patch that will allow MemoryManager to give you more than 1 
page in memory.  NOTE: Max alloc is a little less than 4096 bytes.  But totally 
you can get as much as you want.

Regards,
        Ásgeir

Index: Kernel/Core/ADC/MemoryManager.cs
===================================================================
--- Kernel/Core/ADC/MemoryManager.cs  (revision 457)
+++ Kernel/Core/ADC/MemoryManager.cs  (working copy)
@@ -81,11 +81,21 @@
                               return null;

                       Header* currentNode            = firstEmptyNode;
-                      // Try to find a node with the exact same size...
+                      // Try to find a node with some space...
                       while (currentNode != null)
                       {
-                              if (currentNode->nodeSize == allocate_size)
+                              if (currentNode->nodeSize >= allocate_size)
                                      break;
+
+                              if (currentNode->nextNode == null)
+                              {
+                                     // This should be done in a sepreate 
function
+                                     currentNode->nextNode = 
(Header*)PageAllocator.Alloc();
+                                     currentNode->nextNode->prevNode = null;
+                                     currentNode->nextNode->prevNode = 
currentNode;
+                                     currentNode->nextNode->nodeSize = 
Pager.AtomicPageSize - (uint)sizeof(Header);
+                              }
+
                               currentNode = currentNode->nextNode;
                       }
                       if (currentNode == null)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
SharpOS-Developers mailing list
SharpOS-Developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sharpos-developers

Reply via email to