43 unsigned int old_num_blocks;
44 unsigned int new_num_blocks;
51 if ( old_num_blocks != new_num_blocks ) {
52 new_size = ( new_num_blocks *
sizeof (
bitmap->
blocks[0] ) );
55 DBGC (
bitmap,
"Bitmap %p could not resize to %d " 56 "bits\n",
bitmap, new_length );
63 while ( old_num_blocks < new_num_blocks ) {
static unsigned int unsigned int bit
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.
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.