MySQL 9.1.0
Source Code Documentation
|
Code for handling of priority Queues. More...
#include "storage/myisam/queues.h"
#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <algorithm>
#include "my_dbug.h"
#include "my_macros.h"
#include "my_sys.h"
#include "my_systime.h"
#include "mysql/service_mysql_alloc.h"
#include "storage/myisam/array.h"
#include "storage/myisam/myisamdef.h"
Functions | |
static int | resize_queue (QUEUE *queue, PSI_memory_key key, uint max_elements) |
int | init_queue (QUEUE *queue, PSI_memory_key psi_key, uint max_elements, uint offset_to_key, bool max_at_top, int(*compare)(void *, uchar *, uchar *), 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, int(*compare)(void *, uchar *, uchar *), void *first_cmp_arg) |
void | delete_queue (QUEUE *queue) |
void | queue_insert (QUEUE *queue, uchar *element) |
uchar * | queue_remove (QUEUE *queue, uint idx) |
void | _downheap (QUEUE *queue, uint idx) |
void | queue_fix (QUEUE *queue) |
Code for handling of priority Queues.
Implementation of queues from "Algorithms in C" by Robert Sedgewick. An optimisation of _downheap suggested in Exercise 7.51 in "Data Structures & Algorithms in C++" by Mark Allen Weiss, Second Edition was implemented by Mikael Ronstrom 2005. Also the O(N) algorithm of queue_fix was implemented.
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, | ||
int(*)(void *, uchar *, uchar *) | compare, | ||
void * | first_cmp_arg | ||
) |
void queue_fix | ( | QUEUE * | queue | ) |
int reinit_queue | ( | QUEUE * | queue, |
PSI_memory_key | psi_key, | ||
uint | max_elements, | ||
uint | offset_to_key, | ||
bool | max_at_top, | ||
int(*)(void *, uchar *, uchar *) | compare, | ||
void * | first_cmp_arg | ||
) |
|
static |