#include "tests/vm/qsort.h"
#include <stdbool.h>
#include <debug.h>
#include <random.h>
Go to the source code of this file.
Functions | |
static unsigned char | pick_pivot (unsigned char *buf, size_t size) |
static bool | is_partitioned (const unsigned char *array, size_t size, unsigned char pivot, size_t left_size) |
static void | swap (unsigned char *a, unsigned char *b) |
static size_t | partition (unsigned char *array, size_t size, int pivot) |
static bool | is_sorted (const unsigned char *buf, size_t size) |
void | qsort_bytes (unsigned char *buf, size_t size) |
static bool is_sorted | ( | const unsigned char * | buf, | |
size_t | size | |||
) | [static] |
Definition at line 48 of file qsort.c.
References ASSERT, is_partitioned(), and swap().
Referenced by qsort_bytes().
static unsigned char pick_pivot | ( | unsigned char * | buf, | |
size_t | size | |||
) | [static] |
Definition at line 8 of file qsort.c.
References ASSERT, and random_ulong().
Referenced by qsort_bytes().
void qsort_bytes | ( | unsigned char * | buf, | |
size_t | size | |||
) |
Definition at line 114 of file qsort.c.
References is_sorted(), partition(), pick_pivot(), and qsort_bytes().
Referenced by main(), and qsort_bytes().
static void swap | ( | unsigned char * | a, | |
unsigned char * | b | |||
) | [static] |