ROSS
splay.c File Reference
#include <ross.h>

Go to the source code of this file.

Data Structures

struct  tw_pq

Macros

#define ROSS_WARN_TIE_COLLISION   1
#define UP(t)
#define UPUP(t)
#define LEFT(t)
#define RIGHT(t)
#define KEY(t)
#define ROTATE_R(n, p, g)
#define ROTATE_L(n, p, g)

Typedefs

typedef tw_pq splay_tree

Functions

tw_pqtw_pq_create (void)
static unsigned int tw_pq_compare_less_than (tw_event *n, tw_event *e)
static void splay (tw_event *node)
void tw_pq_enqueue (splay_tree *st, tw_event *e)
tw_eventtw_pq_dequeue (splay_tree *st)
void tw_pq_delete_any (splay_tree *st, tw_event *r)
tw_stime tw_pq_minimum (splay_tree *pq)
unsigned int tw_pq_get_size (splay_tree *st)
unsigned int tw_pq_max_size (splay_tree *pq)

Macro Definition Documentation

◆ KEY

#define KEY ( t)
Value:
((t)->recv_ts)

Definition at line 36 of file splay.c.

Referenced by tw_pq_compare_less_than().

◆ LEFT

#define LEFT ( t)
Value:
((t)->next)

Definition at line 34 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

◆ RIGHT

#define RIGHT ( t)
Value:
((t)->prev)

Definition at line 35 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

◆ ROSS_WARN_TIE_COLLISION

#define ROSS_WARN_TIE_COLLISION   1

Definition at line 30 of file splay.c.

◆ ROTATE_L

#define ROTATE_L ( n,
p,
g )
Value:
if((RIGHT(p) = LEFT(n))) UP(LEFT(n)) = p; LEFT(n) = p; \
UP(n) = g; UP(p) = n;
#define LEFT(t)
Definition splay.c:34
#define UP(t)
Definition splay.c:32
#define RIGHT(t)
Definition splay.c:35

Definition at line 51 of file splay.c.

Referenced by splay().

◆ ROTATE_R

#define ROTATE_R ( n,
p,
g )
Value:
if((LEFT(p) = RIGHT(n))) UP(RIGHT(n)) = p; RIGHT(n) = p; \
UP(n) = g; UP(p) = n;

Definition at line 47 of file splay.c.

Referenced by splay().

◆ UP

#define UP ( t)
Value:
((t)->up)

Definition at line 32 of file splay.c.

Referenced by splay(), tw_pq_delete_any(), tw_pq_dequeue(), and tw_pq_enqueue().

◆ UPUP

#define UPUP ( t)
Value:
((t)->up->up)

Definition at line 33 of file splay.c.

Referenced by splay().

Typedef Documentation

◆ splay_tree

typedef tw_pq splay_tree

Definition at line 45 of file splay.c.

Function Documentation

◆ splay()

void splay ( tw_event * node)
static

Definition at line 147 of file splay.c.

References LEFT, RIGHT, ROTATE_L, ROTATE_R, UP, and UPUP.

Referenced by tw_pq_delete_any(), and tw_pq_enqueue().

◆ tw_pq_compare_less_than()

unsigned int tw_pq_compare_less_than ( tw_event * n,
tw_event * e )
static

◆ tw_pq_create()

tw_pq * tw_pq_create ( void )

Definition at line 56 of file splay.c.

References tw_pq::least, tw_pq::nitems, tw_pq::root, tw_calloc(), and TW_LOC.

Referenced by setup_pes().

◆ tw_pq_delete_any()

void tw_pq_delete_any ( splay_tree * st,
tw_event * r )

◆ tw_pq_dequeue()

◆ tw_pq_enqueue()

◆ tw_pq_get_size()

unsigned int tw_pq_get_size ( splay_tree * st)

Definition at line 418 of file splay.c.

References tw_pq::nitems.

Referenced by st_collect_engine_data_pes(), tw_get_stats(), and tw_gvt_hook_step_seq().

◆ tw_pq_max_size()

unsigned int tw_pq_max_size ( splay_tree * pq)

Definition at line 424 of file splay.c.

References tw_pq::max_size.

Referenced by gvt_print().

◆ tw_pq_minimum()