#include <cghdr.h>
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
/*
* reference counted strings.
*/
extern "C" {
#endif
-#ifdef DMALLOC
-#define NEW(t) (t*)calloc(1,sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
-#define GNEW(t) (t*)malloc(sizeof(t))
-#define N_GNEW(n,t) (t*)malloc((n)*sizeof(t))
-#define ALLOC(size,ptr,type) (ptr? (type*)realloc(ptr,(size)*sizeof(type)):(type*)malloc((size)*sizeof(type)))
-#define RALLOC(size,ptr,type) ((type*)realloc(ptr,(size)*sizeof(type)))
-#define ZALLOC(size,ptr,type,osize) (ptr? (type*)recalloc(ptr,(size)*sizeof(type)):(type*)calloc((size),sizeof(type)))
-#else
#define NEW(t) (t*)zmalloc(sizeof(t))
#define N_NEW(n,t) (t*)zmalloc((n)*sizeof(t))
#define GNEW(t) (t*)gmalloc(sizeof(t))
#define ALLOC(size,ptr,type) (ptr? (type*)grealloc(ptr,(size)*sizeof(type)):(type*)gmalloc((size)*sizeof(type)))
#define RALLOC(size,ptr,type) ((type*)grealloc(ptr,(size)*sizeof(type)))
#define ZALLOC(size,ptr,type,osize) (ptr? (type*)zrealloc(ptr,size,sizeof(type),osize):(type*)zmalloc((size)*sizeof(type)))
-#endif
#ifdef GVDLL
#define extern __declspec(dllexport)
#else
#define EXTERN
#include "libgraph.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
Agdict_t *agdictof(void *obj)
{
Agdict_t *d = NULL;
#include "libgraph.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#if 0
/* graphs_of_e() is never used - suppress compiler warnings. */
static void graphs_of_e(Agedge_t * e, Dict_t * g_e, Agraph_t * g)
#include "libgraph.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
Dtdisc_t agNamedisc = {
offsetof(Agnode_t, name),
-1,
#include "triefa.cP"
#include "agxbuf.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#define InfileName (InputFile?InputFile:"<unknown>")
static FILE *Lexer_fp;
#include "libgraph.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
Agnode_t *agfindnode(Agraph_t * g, char *name)
{
Agnode_t *rv;
#include "libgraph.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
static char *Port;
static char In_decl,In_edge_stmt;
static int Current_class,Agraph_type;
static unsigned int HTML_BIT;
static unsigned int CNT_BITS;
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
typedef struct refstr_t {
Dtlink_t link;
unsigned int refcnt;
#include "parser.h"
#include "triefa.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
TrieState TrieStateTbl[34] = {
{-1, 0, 0x42058}
,
#include <stdio.h>
#include "vis.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
typedef Ppoint_t ilcoord_t;
#ifdef DEBUG
#include "vispath.h"
#include "pathutil.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
int in_poly(Ppoly_t poly, Ppoint_t q)
{
int i, i1; /* point index; i1 = i-1 mod n */
#include "pathutil.h"
#include "solvers.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#define EPSILON1 1E-3
#define EPSILON2 1E-6
#include <math.h>
#include "pathutil.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#define ISCCW 1
#define ISCW 2
#define ISON 3
#include "vis.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
static COORD unseen = (double) INT_MAX;
/* shortestPath:
#include <math.h>
#include "solvers.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#ifndef HAVE_CBRT
#define cbrt(x) ((x < 0) ? (-1*pow(-x, 1.0/3.0)) : pow (x, 1.0/3.0))
#endif
#include "pathutil.h"
#include "tri.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
typedef struct lvertex_2_t {
double x, y;
} lvertex_2_t;
#include <stdlib.h>
#include "pathutil.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
#define ALLOC(size,ptr,type) (ptr? (type*)realloc(ptr,(size)*sizeof(type)):(type*)malloc((size)*sizeof(type)))
Ppoly_t copypoly(Ppoly_t argpoly)
#include "vis.h"
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
/* TRANSPARENT means router sees past colinear obstacles */
#ifdef TRANSPARENT
#define INTERSECT(a,b,c,d,e) intersect1((a),(b),(c),(d),(e))
CLEANFILES = inkpot_lib_*.dat
EXTRA_DIST = LICENSE CHANGES makefile.txt test_red_black_tree.c \
- simple_test.sh test_rb rbtree.vcxproj*
+ test_rb rbtree.vcxproj*
# prompt> make
# builds everything and links in test program test_rb
-#
-# prompt> make mem_check
-# Rebuilds everything using dmalloc and does memory testing.
-# Only works if you have dmalloc installed (see http://dmalloc.com).
SRCS = test_red_black_tree.c red_black_tree.c stack.c misc.c
PROGRAM = test_rb
-.PHONY: mem_check clean
+.PHONY: clean
all: $(PROGRAM)
$(PROGRAM): $(OBJS)
- $(CC) $(CFLAGS) $(OBJS) -o $(PROGRAM) $(DMALLOC_LIB)
-
-mem_check:
- @if [ -e makefile.txt ] ; then \
- echo "Using makefile.txt" ; \
- $(MAKE) clean -f makefile.txt ; \
- $(MAKE) $(PROGRAM) "CFLAGS=$(CFLAGS) -DDMALLOC" "DMALLOC_LIB=-ldmalloc" -f makefile.txt ; \
- else \
- echo "Using default makefile (i.e. no -f flag)." ; \
- $(MAKE) clean ; \
- $(MAKE) $(PROGRAM) "CFLAGS=$(CFLAGS) -DDMALLOC" "DMALLOC_LIB=-ldmalloc" ; \
- fi
- ./simple_test.sh
- @if [ -s unfreed.txt ] ; then \
- echo " " ; \
- echo "Leaked some memory. See logfile for details." ;\
- else \
- echo " " ; \
- echo "No memory leaks detected. " ;\
- echo " " ; \
- echo "Test passed. " ; \
- echo " " ; \
- fi
-
+ $(CC) $(CFLAGS) $(OBJS) -o $(PROGRAM)
test_red_black_tree.o: test_red_black_tree.c red_black_tree.c stack.c stack.h red_black_tree.h misc.h
extern "C" {
#endif
-#ifdef DMALLOC
-#include <dmalloc.h>
-#endif
#include "misc.h"
#include "stack.h"
+++ /dev/null
-#!/bin/sh
-eval `dmalloc -l logfile -i 100 high`
-./test_rb<<EOF
-1
-1
-1
-2
-1
-3
-1
-4
-1
-5
-7
-1
-9
-1
-11
-1
--87
-3
-10
-3
--87
-3
-6
-4
-3
-3
-99
-5
-2
-5
-99
-5
-1
-6
--1
-10
-2
-2
-2
-4
-7
-8
-EOF
-
-grep "not freed" logfile | tee unfreed.txt
-
-echo "DMALLOC_OPTIONS were :"
-printenv DMALLOC_OPTIONS
-
-exit 0
\ No newline at end of file
/* Added 2000-09-19 by KG for memcpy, ... decls */
#include <string.h>
-#ifdef DMALLOC
-#include "dmalloc.h"
-#endif
-
-
/*
* Variable set to contain the alignment factor (in bytes) for this machine.
* It is set on the first table initialization.