C:/Users/Dennis/src/lang/russell.orig/src/gc/test.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include "gc.h"
#include "gc_private.h"

Go to the source code of this file.

Data Structures

struct  SEXPR
struct  treenode

Defines

#define nil   ((sexpr) 0)
#define car(x)   ((x) -> sexpr_car)
#define cdr(x)   ((x) -> sexpr_cdr)
#define is_nil(x)   ((x) == nil)
#define a   A.aa

Typedefs

typedef char * void_star
typedef struct SEXPRsexpr
typedef struct treenode tn

Functions

sexpr cons ()
sexpr cons (sexpr x, sexpr y)
sexpr reverse1 (sexpr x, sexpr y)
sexpr reverse (sexpr x)
sexpr ints (int low, int up)
void check_ints (sexpr list, int low, int up)
void print_int_list (sexpr x)
 reverse_test ()
void finalizer (char *obj, char *client_data)
tnmktree (int n)
void chktree (tn *t, int n)
void alloc_small (int n)
 tree_test ()
void run_one_test ()
void check_heap_stats ()
 main ()

Variables

int extra_count = 0
struct {
   char   dummy
   sexpr   aa
A
int finalizable_count = 0
int finalized_count = 0
int dropped_something = 0
size_t counter = 0
int n_tests = 0


Define Documentation

#define a   A.aa

Definition at line 140 of file test.c.

Referenced by accessible(), decl_sort(), findmpsig(), gden_order(), list_to_array(), printn(), reverse_test(), and tsig_order().

#define car (  )     ((x) -> sexpr_car)

Definition at line 33 of file test.c.

Referenced by check_ints(), print_int_list(), and reverse1().

#define cdr (  )     ((x) -> sexpr_cdr)

Definition at line 34 of file test.c.

Referenced by check_ints(), print_int_list(), and reverse1().

#define is_nil (  )     ((x) == nil)

Definition at line 35 of file test.c.

Referenced by print_int_list(), and reverse1().

#define nil   ((sexpr) 0)

Definition at line 32 of file test.c.

Referenced by check_ints(), ints(), and reverse().


Typedef Documentation

typedef struct SEXPR* sexpr

Definition at line 28 of file test.c.

typedef struct treenode tn

typedef char* void_star

Definition at line 25 of file test.c.


Function Documentation

void alloc_small ( int  n  ) 

Definition at line 253 of file test.c.

References GC_MALLOC_ATOMIC.

Referenced by tree_test().

void check_heap_stats (  ) 

Definition at line 303 of file test.c.

References finalizable_count, finalized_count, GC_heapsize, GC_words_allocd, GC_words_allocd_before_gc, and WORDS_TO_BYTES.

Referenced by main().

void check_ints ( sexpr  list,
int  low,
int  up 
)

Definition at line 99 of file test.c.

References car, cdr, and nil.

Referenced by reverse_test().

void chktree ( tn t,
int  n 
)

Definition at line 234 of file test.c.

References GC_MALLOC, treenode::lchild, treenode::level, and treenode::rchild.

Referenced by tree_test().

sexpr cons ( sexpr  x,
sexpr  y 
)

Definition at line 42 of file test.c.

References extra_count, GC_MALLOC, SEXPR::sexpr_car, and SEXPR::sexpr_cdr.

sexpr cons (  ) 

Referenced by ints(), and reverse1().

void finalizer ( char *  obj,
char *  client_data 
)

Definition at line 191 of file test.c.

References finalized_count, and treenode::level.

Referenced by mktree().

sexpr ints ( int  low,
int  up 
)

Definition at line 89 of file test.c.

References cons(), and nil.

Referenced by reverse_test().

main (  ) 

Definition at line 331 of file test.c.

References check_heap_stats(), and run_one_test().

tn* mktree ( int  n  ) 

Definition at line 206 of file test.c.

References finalizable_count, finalizer(), GC_MALLOC, GC_REGISTER_FINALIZER, treenode::lchild, treenode::level, and treenode::rchild.

Referenced by tree_test().

void print_int_list ( sexpr  x  ) 

Definition at line 119 of file test.c.

References car, cdr, and is_nil.

sexpr reverse ( sexpr  x  ) 

Definition at line 83 of file test.c.

References nil, and reverse1().

Referenced by reverse_test().

sexpr reverse1 ( sexpr  x,
sexpr  y 
)

Definition at line 73 of file test.c.

References car, cdr, cons(), and is_nil.

Referenced by reverse().

reverse_test (  ) 

Definition at line 146 of file test.c.

References a, check_ints(), GC_REALLOC, ints(), and reverse().

Referenced by run_one_test().

void run_one_test (  ) 

Definition at line 291 of file test.c.

References DCL_LOCK_STATE, LOCK, reverse_test(), tree_test(), and UNLOCK.

Referenced by main().

tree_test (  ) 

Definition at line 266 of file test.c.

References alloc_small(), chktree(), dropped_something, finalized_count, and mktree().

Referenced by run_one_test().


Variable Documentation

struct { ... } A

sexpr aa

Definition at line 138 of file test.c.

size_t counter = 0

Definition at line 204 of file test.c.

int dropped_something = 0

Definition at line 186 of file test.c.

Referenced by tree_test().

char dummy

Definition at line 137 of file test.c.

int extra_count = 0

Definition at line 38 of file test.c.

Referenced by cons().

int finalizable_count = 0

Definition at line 184 of file test.c.

Referenced by check_heap_stats(), and mktree().

int finalized_count = 0

Definition at line 185 of file test.c.

Referenced by check_heap_stats(), finalizer(), and tree_test().

int n_tests = 0

Definition at line 289 of file test.c.


Generated on Fri Jan 25 10:39:49 2008 for russell by  doxygen 1.5.4