Coda Distributed File System
Classes | Macros | Typedefs | Functions | Variables
rds_private.h File Reference
#include <rvm/rvm.h>
#include <rvm/rvm_segment.h>
#include <rvm/rds.h>
#include <cthreads.h>
Include dependency graph for rds_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fbt
 
struct  free_list_t
 
struct  heap_header_t
 

Macros

#define _RDS_PRIVATE_H_
 
#define RVM_MUTEX   struct mutex
 
#define RVM_CONDITION   struct condition
 
#define START_CRITICAL   mutex_lock(&heap_lock)
 
#define LEAVE_CRITICAL_SECTION   goto end_critical
 
#define END_CRITICAL
 
#define FREE_GUARD   0x345298af
 
#define ALLOC_GUARD   0x783bd92c
 
#define END_GUARD   0xfd10a32e
 
#define RDS_BLOCK_HDR_SIZE   (sizeof(block_size_t) + 2 * sizeof(guard_t))
 
#define BLOCK_END(bp)    ((guard_t *)((char *)(bp) + ((bp)->size * RDS_CHUNK_SIZE)) - 1)
 
#define USER_BLOCK(bp)   ((char *)&((bp)->prev))
 
#define BLOCK_HDR(bp)    ((free_block_t *)((char *)(bp) - (sizeof(block_size_t) + sizeof(guard_t))))
 
#define FREE_LIST_GUARD   0xad938945
 
#define NEXT_CONSECUTIVE_BLOCK(bp)    ((free_block_t *)((char *)(bp) + ((bp)->size * RDS_CHUNK_SIZE)))
 
#define HEAP_LIST_GROWSIZE   20 /* Number of blocks to prealloc */
 
#define RDS_HEAP_VERSION   "Dynamic Allocator Using Rvm Release 0.1 1 Dec 1990"
 
#define RDS_VERSION_MAX   80
 
#define HEAP_INIT   (RecoverableHeapStartAddress != 0)
 
#define RDS_VERSION_STAMP   (RecoverableHeapStartAddress->version)
 
#define RDS_HEAPLENGTH   (RecoverableHeapStartAddress->heaplength)
 
#define RDS_CHUNK_SIZE   (RecoverableHeapStartAddress->chunk_size)
 
#define RDS_FREE_LIST   (RecoverableHeapStartAddress->lists)
 
#define RDS_NLISTS   (RecoverableHeapStartAddress->nlists)
 
#define RDS_MAXLIST   (RecoverableHeapStartAddress->maxlist)
 
#define RDS_STATS   (RecoverableHeapStartAddress->stats)
 
#define RDS_HIGH_ADDR   (RecoverableHeapHighAddress)
 
#define BCOPY(S, D, L)   bcopy((S), (D), (L))
 
#define BZERO(D, L)   bzero((D), (L))
 

Typedefs

typedef unsigned long block_size_t
 
typedef unsigned long guard_t
 
typedef struct fbt free_block_t
 

Functions

int print_heap ()
 
free_block_tsplit ()
 
free_block_tget_block ()
 
int put_block ()
 
int rm_from_list ()
 
int merge_with_next_free (free_block_t *fbp, rvm_tid_t *tid, int *err)
 
void coalesce (rvm_tid_t *tid, int *err)
 

Variables

heap_header_tRecoverableHeapStartAddress
 
free_block_tRecoverableHeapHighAddress
 
RVM_MUTEX heap_lock
 
int rds_tracing
 
FILE * rds_tracing_file
 

Macro Definition Documentation

◆ _RDS_PRIVATE_H_

#define _RDS_PRIVATE_H_

◆ ALLOC_GUARD

#define ALLOC_GUARD   0x783bd92c

◆ BCOPY

#define BCOPY (   S,
  D,
 
)    bcopy((S), (D), (L))

◆ BLOCK_END

#define BLOCK_END (   bp)     ((guard_t *)((char *)(bp) + ((bp)->size * RDS_CHUNK_SIZE)) - 1)

◆ BLOCK_HDR

#define BLOCK_HDR (   bp)     ((free_block_t *)((char *)(bp) - (sizeof(block_size_t) + sizeof(guard_t))))

◆ BZERO

#define BZERO (   D,
 
)    bzero((D), (L))

◆ END_CRITICAL

#define END_CRITICAL
Value:
goto end_critical; \
end_critical: \
mutex_unlock(&heap_lock)
RVM_MUTEX heap_lock
Definition: rds_start.c:59

◆ END_GUARD

#define END_GUARD   0xfd10a32e

◆ FREE_GUARD

#define FREE_GUARD   0x345298af

◆ FREE_LIST_GUARD

#define FREE_LIST_GUARD   0xad938945

◆ HEAP_INIT

#define HEAP_INIT   (RecoverableHeapStartAddress != 0)

◆ HEAP_LIST_GROWSIZE

#define HEAP_LIST_GROWSIZE   20 /* Number of blocks to prealloc */

◆ LEAVE_CRITICAL_SECTION

#define LEAVE_CRITICAL_SECTION   goto end_critical

◆ NEXT_CONSECUTIVE_BLOCK

#define NEXT_CONSECUTIVE_BLOCK (   bp)     ((free_block_t *)((char *)(bp) + ((bp)->size * RDS_CHUNK_SIZE)))

◆ RDS_BLOCK_HDR_SIZE

#define RDS_BLOCK_HDR_SIZE   (sizeof(block_size_t) + 2 * sizeof(guard_t))

◆ RDS_CHUNK_SIZE

#define RDS_CHUNK_SIZE   (RecoverableHeapStartAddress->chunk_size)

◆ RDS_FREE_LIST

#define RDS_FREE_LIST   (RecoverableHeapStartAddress->lists)

◆ RDS_HEAP_VERSION

#define RDS_HEAP_VERSION   "Dynamic Allocator Using Rvm Release 0.1 1 Dec 1990"

◆ RDS_HEAPLENGTH

#define RDS_HEAPLENGTH   (RecoverableHeapStartAddress->heaplength)

◆ RDS_HIGH_ADDR

#define RDS_HIGH_ADDR   (RecoverableHeapHighAddress)

◆ RDS_MAXLIST

#define RDS_MAXLIST   (RecoverableHeapStartAddress->maxlist)

◆ RDS_NLISTS

#define RDS_NLISTS   (RecoverableHeapStartAddress->nlists)

◆ RDS_STATS

#define RDS_STATS   (RecoverableHeapStartAddress->stats)

◆ RDS_VERSION_MAX

#define RDS_VERSION_MAX   80

◆ RDS_VERSION_STAMP

#define RDS_VERSION_STAMP   (RecoverableHeapStartAddress->version)

◆ RVM_CONDITION

#define RVM_CONDITION   struct condition

◆ RVM_MUTEX

#define RVM_MUTEX   struct mutex

◆ START_CRITICAL

#define START_CRITICAL   mutex_lock(&heap_lock)

◆ USER_BLOCK

#define USER_BLOCK (   bp)    ((char *)&((bp)->prev))

Typedef Documentation

◆ block_size_t

typedef unsigned long block_size_t

◆ free_block_t

typedef struct fbt free_block_t

◆ guard_t

typedef unsigned long guard_t

Function Documentation

◆ coalesce()

void coalesce ( rvm_tid_t tid,
int *  err 
)

◆ get_block()

free_block_t * get_block ( )

◆ merge_with_next_free()

int merge_with_next_free ( free_block_t fbp,
rvm_tid_t tid,
int *  err 
)

◆ print_heap()

int print_heap ( )

◆ put_block()

int put_block ( )

◆ rm_from_list()

int rm_from_list ( )

◆ split()

free_block_t * split ( )

Variable Documentation

◆ heap_lock

RVM_MUTEX heap_lock
extern

◆ rds_tracing

int rds_tracing
extern

◆ rds_tracing_file

FILE* rds_tracing_file
extern

◆ RecoverableHeapHighAddress

free_block_t* RecoverableHeapHighAddress
extern

◆ RecoverableHeapStartAddress

heap_header_t* RecoverableHeapStartAddress
extern