Changeset 139

Show
Ignore:
Timestamp:
06/15/06 05:32:23 (3 years ago)
Author:
jtv
Message:

Compile fixes: seems PAGE_SIZE is not a constant anymore on gcc 4.0

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/debian/changelog

    r125 r139  
     1swapspace (1.6) stable; urgency=low 
     2 
     3 * Attempt to free up all swapfiles on uninstall 
     4 * Compile fixes: PAGE_SIZE is not a constant anymore 
     5 * Makefile supports dist and distclean targets 
     6 * Updated to newer version of Debian standards 
     7 * Documented algorithm as Finite State Machine graph (using graphviz) 
     8 * Updated copyright notices 
     9 
     10 -- Jeroen T. Vermeulen <jtv@thaiopensource.org>  Thu, 15 Jun 2006 16:20:00 +0700 
     11 
    112swapspace (1.5) unstable; urgency=low 
    213 
  • trunk/src/main.c

    r138 r139  
    4646#include "swaps.h" 
    4747 
    48 char localbuf[8192]; 
     48char localbuf[16384]; 
    4949time_t clock = 0; 
    5050 
     
    386386int main(int argc, char *argv[]) 
    387387{ 
     388  assert(sizeof(localbuf) >= PAGE_SIZE); 
     389 
    388390  close(STDIN_FILENO); 
    389391  setlocale(LC_ALL, "C"); 
  • trunk/src/main.h

    r138 r139  
    4141 * allocation (and even wild fluctuations in stack use) may really matter here. 
    4242 * 
    43  * Size is best kept to an even multiple of page size. 
     43 * Size is best kept to an even multiple of page size, and is guaranteed to be 
     44 * no less than PAGE_SIZE. 
    4445 */ 
    45 extern char localbuf[PAGE_SIZE*2]; 
     46extern char localbuf[16384]; 
    4647 
    4748/// Timestamp counter 
  • trunk/src/opts.c

    r138 r139  
    100100  { "lower_freelimit",  'l', at_num,  0, 99, set_lower_freelimit, 
    101101  "Try to keep at least n% of memory/swap available" }, 
    102   { "max_swapsize",     'M', at_num, PAGE_SIZE, LLONG_MAX, set_max_swapsize, 
     102  { "max_swapsize",     'M', at_num, 8192, LLONG_MAX, set_max_swapsize, 
    103103  "Restrict swapfiles to n bytes" }, 
    104   { "min_swapsize",     'm', at_num, PAGE_SIZE, LLONG_MAX, set_min_swapsize, 
     104  { "min_swapsize",     'm', at_num, 8192, LLONG_MAX, set_min_swapsize, 
    105105  "Don't create swapfiles smaller than n bytes" }, 
    106106  { "paranoid",         'P', at_none, 0, 0, set_paranoid, 
  • trunk/src/swaps.c

    r138 r139  
    6060 
    6161/// Smallest allowed swapfile size 
    62 static memsize_t min_swapsize = TRUNC_TO_PAGE(4*MEGA)
     62static memsize_t min_swapsize = 4*MEGA
    6363/// Largest allowed swapfile size 
    6464/** Don't set this too low.  The program will learn if it runs into file size 
    6565 * limits. 
    6666 */ 
    67 static memsize_t max_swapsize = TRUNC_TO_PAGE(2*TERA)
     67static memsize_t max_swapsize = 2*TERA
    6868 
    6969