/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* memfile.c: Contains the functions for handling blocks of memory which can
* be stored in a file. This is the implementation of a sort of virtual memory.
*
* A memfile consists of a sequence of blocks. The blocks numbered from 0
* upwards have been assigned a place in the actual file. The block number
* is equal to the page number in the file. The
* blocks with negative numbers are currently in memory only. They can be
* assigned a place in the file when too much memory is being used. At that
* moment they get a new, positive, number. A list is used for translation of
* negative to positive numbers.
*
* The size of a block is a multiple of a page size, normally the page size of
* the device the file is on. Most blocks are 1 page long. A Block of multiple
* pages is used for a line that does not fit in a single page.
*
* Each block can be in memory and/or in a file. The block stays in memory
* as long as it is locked. If it is no longer locked it can be swapped out to
* the file. It is only written to the file if it has been changed.
*
* Under normal operation the file is created when opening the memory file and
* deleted when closing the memory file. Only with recovery an existing memory
* file is opened.
*/
#include "vim.h"
/*
* Some systems have the page size in statfs.f_bsize, some in stat.st_blksize