44 unsigned int old_num_blocks;
45 unsigned int new_num_blocks;
52 if ( old_num_blocks != new_num_blocks ) {
53 new_size = ( new_num_blocks *
sizeof (
bitmap->
blocks[0] ) );
56 DBGC (
bitmap,
"Bitmap %p could not resize to %d " 57 "bits\n",
bitmap, new_length );
64 while ( old_num_blocks < new_num_blocks ) {
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
#define BITMAP_BLKSIZE
Size of a block of bits (in bits)
unsigned int length
Length of the bitmap, in bits.
unsigned long bitmap_block_t
A single block of bits within a bitmap.
static unsigned int unsigned int bit
bitmap_block_t * blocks
Bitmap data.
int bitmap_test(struct bitmap *bitmap, unsigned int bit)
Test bit in bitmap.
#define BITMAP_INDEX(bit)
Block index within bitmap.
#define ENOMEM
Not enough space.
int bitmap_resize(struct bitmap *bitmap, unsigned int new_length)
Resize bitmap.
unsigned int first_gap
Index of first gap in the bitmap.
void bitmap_set(struct bitmap *bitmap, unsigned int bit)
Set bit in bitmap.
Bitmaps for multicast downloads.
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
#define BITMAP_MASK(bit)
Block mask within bitmap.