]> mj.ucw.cz Git - libucw.git/blobdiff - lib/pagecache.c
I always wanted to rename the rather inconsistent memory pool modules.
[libucw.git] / lib / pagecache.c
index e987a5fead8da24d795b5c2d8f6a062b695bcb15..6a2643dfae7547caceae0098ec926b076fd8f141 100644 (file)
@@ -2,6 +2,9 @@
  *     Sherlock Library -- File Page Cache
  *
  *     (c) 1999--2002 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #include "lib/lib.h"
@@ -13,6 +16,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <alloca.h>
 
 struct page_cache {
   list free_pages;                     /* LRU queue of free non-dirty pages */
@@ -139,7 +143,7 @@ static void
 flush_pages(struct page_cache *c, uns force)
 {
   uns cnt = 0;
-  uns max = force ? ~0U : c->free_count / 2; /* FIXME: Needs tuning */
+  uns max = force ? ~0U : c->free_count / 2;
   uns i;
   struct page *p, *q, **req, **rr;
 
@@ -339,7 +343,7 @@ pgc_put(struct page_cache *c, struct page *p)
   else
     {
       rem_node(&p->hn);
-      free(p);
+      xfree(p);
       c->total_count--;
     }
 }