PandA-2024.02
Data Structures | Macros | Functions
qsort-specialized.c File Reference
#include <limits.h>
#include <stdlib.h>
Include dependency graph for qsort-specialized.c:

Go to the source code of this file.

Data Structures

struct  stack_node
 

Macros

#define SWAP(a, b, size)
 
#define MAX_THRESH   4
 
#define STACK_SIZE   (CHAR_BIT * sizeof(size_t))
 
#define PUSH(low, high)   ((void) ((top->lo = (low)), (top->hi = (high)), ++top))
 
#define POP(low, high)   ((void) (--top, (low = top->lo), (high = top->hi)))
 
#define STACK_NOT_EMPTY   (stack < top)
 
#define min(x, y)   ((x) < (y) ? (x) : (y))
 

Functions

int less (const void *, const void *, void *)
 
void _quicksort (void *const pbase, size_t total_elems, size_t size, int(*cmp)(const void *, const void *, void *), void *arg)
 

Macro Definition Documentation

◆ MAX_THRESH

#define MAX_THRESH   4

Definition at line 42 of file qsort-specialized.c.

Referenced by _quicksort().

◆ min

#define min (   x,
 
)    ((x) < (y) ? (x) : (y))

Referenced by _quicksort().

◆ POP

#define POP (   low,
  high 
)    ((void) (--top, (low = top->lo), (high = top->hi)))

Definition at line 58 of file qsort-specialized.c.

Referenced by _quicksort().

◆ PUSH

#define PUSH (   low,
  high 
)    ((void) ((top->lo = (low)), (top->hi = (high)), ++top))

Definition at line 57 of file qsort-specialized.c.

Referenced by _quicksort().

◆ STACK_NOT_EMPTY

#define STACK_NOT_EMPTY   (stack < top)

Definition at line 59 of file qsort-specialized.c.

Referenced by _quicksort().

◆ STACK_SIZE

#define STACK_SIZE   (CHAR_BIT * sizeof(size_t))

Definition at line 56 of file qsort-specialized.c.

Referenced by _quicksort().

◆ SWAP

#define SWAP (   a,
  b,
  size 
)
Value:
do \
{ \
size_t __size = (size); \
char *__a = (a), *__b = (b); \
do \
{ \
char __tmp = *__a; \
*__a++ = *__b; \
*__b++ = __tmp; \
} while (--__size > 0); \
} while (0)

Definition at line 27 of file qsort-specialized.c.

Referenced by _quicksort().

Function Documentation

◆ _quicksort()

void _quicksort ( void *const  pbase,
size_t  total_elems,
size_t  size,
int(*)(const void *, const void *, void *)  cmp,
void *  arg 
)

Definition at line 88 of file qsort-specialized.c.

References less(), MAX_THRESH, min, NULL, POP, PUSH, STACK_NOT_EMPTY, STACK_SIZE, SWAP, and top().

Here is the call graph for this function:

◆ less()

int less ( const void *  ,
const void *  ,
void *   
)

Definition at line 4 of file less.c.

References aggregate::a0, aggregate::a1, aggregate::a2, aggregate::a3, aggregate::a4, aggregate::a5, aggregate::a6, and aggregate::a7.

Referenced by _quicksort(), qsort_r(), sift(), and trinkle().

Here is the caller graph for this function:

Generated on Mon Feb 12 2024 13:03:09 for PandA-2024.02 by doxygen 1.8.13