tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
heap.c File Reference
#include <stdlib.h>
#include <assert.h>
#include "heap.h"
#include "tm.h"
#include "types.h"
Include dependency graph for heap.c:

Classes

struct  heap
 

Macros

#define PARENT(i)   ((i) / 2)
 
#define LEFT_CHILD(i)   (2*i)
 
#define RIGHT_CHILD(i)   (2*(i) + 1)
 

Functions

static TM_CALLABLE void TMsiftUp (TM_ARGDECL heap_t *heapPtr, long startIndex)
 
static TM_CALLABLE void TMheapify (TM_ARGDECL heap_t *heapPtr, long startIndex)
 
heap_theap_alloc (long initCapacity, comparator_t *compare)
 
heap_tTMheap_alloc (TM_ARGDECL long initCapacity, comparator_t *compare)
 
void heap_free (heap_t *heapPtr)
 
static void siftUp (heap_t *heapPtr, long startIndex)
 
bool_t heap_insert (heap_t *heapPtr, void *dataPtr)
 
bool_t TMheap_insert (TM_ARGDECL heap_t *heapPtr, void *dataPtr)
 
static void heapify (heap_t *heapPtr, long startIndex)
 
void * heap_remove (heap_t *heapPtr)
 
void * TMheap_remove (TM_ARGDECL heap_t *heapPtr)
 
bool_t heap_isValid (heap_t *heapPtr)
 

Macro Definition Documentation

#define LEFT_CHILD (   i)    (2*i)
#define PARENT (   i)    ((i) / 2)
#define RIGHT_CHILD (   i)    (2*(i) + 1)

Function Documentation

heap_t* heap_alloc ( long  initCapacity,
comparator_t compare 
)

Here is the caller graph for this function:

void heap_free ( heap_t heapPtr)
bool_t heap_insert ( heap_t heapPtr,
void *  dataPtr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

bool_t heap_isValid ( heap_t heapPtr)

Here is the call graph for this function:

void* heap_remove ( heap_t heapPtr)

Here is the call graph for this function:

static void heapify ( heap_t heapPtr,
long  startIndex 
)
static

Here is the caller graph for this function:

static void siftUp ( heap_t heapPtr,
long  startIndex 
)
static

Here is the caller graph for this function:

heap_t* TMheap_alloc ( TM_ARGDECL long  initCapacity,
comparator_t compare 
)
bool_t TMheap_insert ( TM_ARGDECL heap_t heapPtr,
void *  dataPtr 
)

Here is the call graph for this function:

void* TMheap_remove ( TM_ARGDECL heap_t heapPtr)

Here is the call graph for this function:

static void TMheapify ( TM_ARGDECL heap_t heapPtr,
long  startIndex 
)
static

Here is the caller graph for this function:

static void TMsiftUp ( TM_ARGDECL heap_t heapPtr,
long  startIndex 
)
static

Here is the caller graph for this function: