MySQL 9.1.0
Source Code Documentation
|
Code for handling of priority queues. More...
#include <stddef.h>
#include <sys/types.h>
#include "my_inttypes.h"
#include "mysql/psi/psi_memory.h"
Go to the source code of this file.
Classes | |
struct | QUEUE |
Macros | |
#define | queue_top(queue) ((queue)->root[1]) |
#define | queue_element(queue, index) ((queue)->root[index + 1]) |
#define | queue_end(queue) ((queue)->root[(queue)->elements]) |
Typedefs | |
typedef int(* | queue_compare) (void *, uchar *, uchar *) |
Functions | |
void | _downheap (QUEUE *queue, uint idx) |
void | queue_fix (QUEUE *queue) |
static void | queue_replaced (QUEUE *queue) |
static void | queue_set_max_at_top (QUEUE *queue, int set_arg) |
int | init_queue (QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, bool max_at_top, queue_compare compare, void *first_cmp_arg) |
int | reinit_queue (QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, bool max_at_top, queue_compare compare, void *first_cmp_arg) |
void | delete_queue (QUEUE *queue) |
void | queue_insert (QUEUE *queue, uchar *element) |
uchar * | queue_remove (QUEUE *queue, uint idx) |
static void | queue_remove_all (QUEUE *queue) |
static bool | queue_is_full (QUEUE *queue) |
static bool | is_queue_inited (QUEUE *queue) |
Code for handling of priority queues.
Implementation of queues from "Algorithms in C" by Robert Sedgewick.
void _downheap | ( | QUEUE * | queue, |
uint | idx | ||
) |
void delete_queue | ( | QUEUE * | queue | ) |
int init_queue | ( | QUEUE * | queue, |
PSI_memory_key | psi_key, | ||
uint | max_elements, | ||
uint | offset_to_key, | ||
bool | max_at_top, | ||
queue_compare | compare, | ||
void * | first_cmp_arg | ||
) |
|
inlinestatic |
void queue_fix | ( | QUEUE * | queue | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
int reinit_queue | ( | QUEUE * | queue, |
PSI_memory_key | psi_key, | ||
uint | max_elements, | ||
uint | offset_to_key, | ||
bool | max_at_top, | ||
queue_compare | compare, | ||
void * | first_cmp_arg | ||
) |