Go to the documentation of this file.
17 #define LONG_BIT_SHIFT 6
18 #define BITS_IN_A_LONG 0x40
19 #define LONG_BIT_MASK 0x3F
20 #define ALL_ONES (unsigned long) 0xFFFFFFFFFFFFFFFF
21 #elif SIZEOF_LONG == 4
22 #define LONG_BIT_SHIFT 5
23 #define BITS_IN_A_LONG 0x20
24 #define LONG_BIT_MASK 0x1F
25 #define ALL_ONES (unsigned long) 0xFFFFFFFF
27 #define LONG_BIT_SHIFT 5
28 #define BITS_IN_A_LONG 0x20
29 #define LONG_BIT_MASK 0x1F
30 #define ALL_ONES (unsigned long) 0xFFFFFFFF
33 #define FM_INITIAL_NUMBER (1<<14)
47 int old_sz =
nwords *
sizeof(*bitmap);
55 debugs(8, 3,
"copying " << old_sz <<
" old bytes");
56 memcpy(
bitmap, old_map, old_sz);
64 unsigned long bitmask = (1L << (file_number &
LONG_BIT_MASK));
86 unsigned long bitmask = (1L << (file_number &
LONG_BIT_MASK));
94 unsigned long bitmask = (1L << (file_number &
LONG_BIT_MASK));
116 for (
unsigned int count = 0; count <
nwords; ++count) {
120 word = (word + 1) %
nwords;
unsigned int usedSlots_
used slots in the map
void * xcalloc(size_t n, size_t sz)
unsigned int nwords
number of "long ints" making up the filemap
bool testBit(sfileno num) const
Test whether the num-th bit in the FileMap is set.
#define FM_INITIAL_NUMBER
sfileno capacity_
max number of files which can be tracked in the current store
void grow()
grow the FileMap (size is doubled each time, up to 2^24 bits)
void clearBit(sfileno num)
sfileno allocate(sfileno suggestion)
#define debugs(SECTION, LEVEL, CONTENT)