MySQL  8.0.18
Source Code Documentation
my_bitmap.h File Reference
#include <string.h>
#include <sys/types.h>
#include "my_dbug.h"
#include "my_inttypes.h"
#include "mysql/psi/mysql_mutex.h"

Go to the source code of this file.

Classes

struct  MY_BITMAP
 

Macros

#define MY_BIT_NONE   (~(uint)0)
 
#define bitmap_buffer_size(bits)   (((bits) + 31) / 32) * 4
 
#define no_bytes_in_map(map)   (((map)->n_bits + 7) / 8)
 
#define no_words_in_map(map)   (((map)->n_bits + 31) / 32)
 

Typedefs

typedef uint32 my_bitmap_map
 

Functions

void create_last_word_mask (MY_BITMAP *map)
 
bool bitmap_init (MY_BITMAP *map, my_bitmap_map *buf, uint n_bits, bool thread_safe)
 
bool bitmap_is_clear_all (const MY_BITMAP *map)
 
bool bitmap_is_prefix (const MY_BITMAP *map, uint prefix_size)
 
bool bitmap_is_set_all (const MY_BITMAP *map)
 
bool bitmap_is_subset (const MY_BITMAP *map1, const MY_BITMAP *map2)
 
bool bitmap_is_overlapping (const MY_BITMAP *map1, const MY_BITMAP *map2)
 
bool bitmap_test_and_set (MY_BITMAP *map, uint bitmap_bit)
 
bool bitmap_test_and_clear (MY_BITMAP *map, uint bitmap_bit)
 
bool bitmap_fast_test_and_set (MY_BITMAP *map, uint bitmap_bit)
 
uint bitmap_set_next (MY_BITMAP *map)
 
uint bitmap_get_first (const MY_BITMAP *map)
 
uint bitmap_get_first_set (const MY_BITMAP *map)
 
uint bitmap_get_next_set (const MY_BITMAP *map, uint bitmap_bit)
 Get the next set bit. More...
 
uint bitmap_bits_set (const MY_BITMAP *map)
 
void bitmap_free (MY_BITMAP *map)
 
void bitmap_set_above (MY_BITMAP *map, uint from_byte, uint use_bit)
 
void bitmap_set_prefix (MY_BITMAP *map, uint prefix_size)
 Set the specified number of bits in the bitmap buffer. More...
 
void bitmap_intersect (MY_BITMAP *map, const MY_BITMAP *map2)
 
void bitmap_subtract (MY_BITMAP *map, const MY_BITMAP *map2)
 
void bitmap_union (MY_BITMAP *map, const MY_BITMAP *map2)
 
void bitmap_xor (MY_BITMAP *map, const MY_BITMAP *map2)
 
void bitmap_invert (MY_BITMAP *map)
 
void bitmap_copy (MY_BITMAP *map, const MY_BITMAP *map2)
 
uint bitmap_lock_set_next (MY_BITMAP *map)
 
void bitmap_lock_clear_bit (MY_BITMAP *map, uint bitmap_bit)
 
static void bitmap_set_bit (MY_BITMAP *map, uint bit)
 
static void bitmap_flip_bit (MY_BITMAP *map, uint bit)
 
static void bitmap_clear_bit (MY_BITMAP *map, uint bit)
 
static bool bitmap_is_set (const MY_BITMAP *map, uint bit)
 
static bool bitmap_cmp (const MY_BITMAP *map1, const MY_BITMAP *map2)
 Quite unlike other C comparison functions ending with 'cmp', e.g. More...
 
static void bitmap_clear_all (MY_BITMAP *map)
 
static void bitmap_set_all (MY_BITMAP *map)
 

Macro Definition Documentation

◆ bitmap_buffer_size

#define bitmap_buffer_size (   bits)    (((bits) + 31) / 32) * 4

◆ MY_BIT_NONE

#define MY_BIT_NONE   (~(uint)0)

◆ no_bytes_in_map

#define no_bytes_in_map (   map)    (((map)->n_bits + 7) / 8)

◆ no_words_in_map

#define no_words_in_map (   map)    (((map)->n_bits + 31) / 32)

Typedef Documentation

◆ my_bitmap_map

Function Documentation

◆ bitmap_bits_set()

uint bitmap_bits_set ( const MY_BITMAP map)

◆ bitmap_clear_all()

static void bitmap_clear_all ( MY_BITMAP map)
inlinestatic

◆ bitmap_clear_bit()

static void bitmap_clear_bit ( MY_BITMAP map,
uint  bit 
)
inlinestatic

◆ bitmap_cmp()

static bool bitmap_cmp ( const MY_BITMAP map1,
const MY_BITMAP map2 
)
inlinestatic

Quite unlike other C comparison functions ending with 'cmp', e.g.

memcmp(), strcmp(), this function returns true if the bitmaps are equal, and false otherwise.

Return values
trueThe bitmaps are equal.
falseThe bitmaps differ.

◆ bitmap_copy()

void bitmap_copy ( MY_BITMAP map,
const MY_BITMAP map2 
)

◆ bitmap_fast_test_and_set()

bool bitmap_fast_test_and_set ( MY_BITMAP map,
uint  bitmap_bit 
)

◆ bitmap_flip_bit()

static void bitmap_flip_bit ( MY_BITMAP map,
uint  bit 
)
inlinestatic

◆ bitmap_free()

void bitmap_free ( MY_BITMAP map)

◆ bitmap_get_first()

uint bitmap_get_first ( const MY_BITMAP map)

◆ bitmap_get_first_set()

uint bitmap_get_first_set ( const MY_BITMAP map)

◆ bitmap_get_next_set()

uint bitmap_get_next_set ( const MY_BITMAP map,
uint  bitmap_bit 
)

Get the next set bit.

Parameters
mapBitmap
bitmap_bitBit to start search from
Returns
Index to first bit set after bitmap_bit

◆ bitmap_init()

bool bitmap_init ( MY_BITMAP map,
my_bitmap_map buf,
uint  n_bits,
bool  thread_safe 
)

◆ bitmap_intersect()

void bitmap_intersect ( MY_BITMAP map,
const MY_BITMAP map2 
)

◆ bitmap_invert()

void bitmap_invert ( MY_BITMAP map)

◆ bitmap_is_clear_all()

bool bitmap_is_clear_all ( const MY_BITMAP map)

◆ bitmap_is_overlapping()

bool bitmap_is_overlapping ( const MY_BITMAP map1,
const MY_BITMAP map2 
)

◆ bitmap_is_prefix()

bool bitmap_is_prefix ( const MY_BITMAP map,
uint  prefix_size 
)

◆ bitmap_is_set()

static bool bitmap_is_set ( const MY_BITMAP map,
uint  bit 
)
inlinestatic

◆ bitmap_is_set_all()

bool bitmap_is_set_all ( const MY_BITMAP map)

◆ bitmap_is_subset()

bool bitmap_is_subset ( const MY_BITMAP map1,
const MY_BITMAP map2 
)

◆ bitmap_lock_clear_bit()

void bitmap_lock_clear_bit ( MY_BITMAP map,
uint  bitmap_bit 
)

◆ bitmap_lock_set_next()

uint bitmap_lock_set_next ( MY_BITMAP map)

◆ bitmap_set_above()

void bitmap_set_above ( MY_BITMAP map,
uint  from_byte,
uint  use_bit 
)

◆ bitmap_set_all()

static void bitmap_set_all ( MY_BITMAP map)
inlinestatic

◆ bitmap_set_bit()

static void bitmap_set_bit ( MY_BITMAP map,
uint  bit 
)
inlinestatic

◆ bitmap_set_next()

uint bitmap_set_next ( MY_BITMAP map)

◆ bitmap_set_prefix()

void bitmap_set_prefix ( MY_BITMAP map,
uint  prefix_size 
)

Set the specified number of bits in the bitmap buffer.

Parameters
mapBitmap
prefix_sizeNumber of bits to be set

◆ bitmap_subtract()

void bitmap_subtract ( MY_BITMAP map,
const MY_BITMAP map2 
)

◆ bitmap_test_and_clear()

bool bitmap_test_and_clear ( MY_BITMAP map,
uint  bitmap_bit 
)

◆ bitmap_test_and_set()

bool bitmap_test_and_set ( MY_BITMAP map,
uint  bitmap_bit 
)

◆ bitmap_union()

void bitmap_union ( MY_BITMAP map,
const MY_BITMAP map2 
)

◆ bitmap_xor()

void bitmap_xor ( MY_BITMAP map,
const MY_BITMAP map2 
)

◆ create_last_word_mask()

void create_last_word_mask ( MY_BITMAP map)