#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 SEXPR * | sexpr |
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) |
tn * | mktree (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 |
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 | ) | ((x) -> sexpr_car) |
#define cdr | ( | x | ) | ((x) -> sexpr_cdr) |
#define is_nil | ( | x | ) | ((x) == nil) |
#define nil ((sexpr) 0) |
void alloc_small | ( | int | n | ) |
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 | |||
) |
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().
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 | |||
) |
main | ( | ) |
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 | ) |
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().
struct { ... } A |
int dropped_something = 0 |
int extra_count = 0 |
int finalizable_count = 0 |
int finalized_count = 0 |
Definition at line 185 of file test.c.
Referenced by check_heap_stats(), finalizer(), and tree_test().