Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
leaky.cpp File Reference
#include "leaky.h"
#include "dict.h"
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <getopt.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define FALSE   0
#define TRUE   1

Functions

int main (int argc, char **argv)
 The Xalan testcases app.
static voidmapFile (int fd, u_int flags, off_t *sz)
static ptrdiff_t symbolOrder (void const *a, void const *b)

Variables

static const u_int DefaultBuckets = 10007
static const u_int MaxBuckets = 1000003
char * typeFromLog []

Define Documentation

#define FALSE   0

Definition at line 57 of file leaky.cpp.

#define TRUE   1

Definition at line 60 of file leaky.cpp.


Function Documentation

int main ( int  argc,
char **  argv 
)

The Xalan testcases app.

Definition at line 68 of file leaky.cpp.

{
  leaky* l = new leaky;

  l->initialize(argc, argv);
  l->open();
  return 0;
}

Here is the call graph for this function:

static void* mapFile ( int  fd,
u_int  flags,
off_t sz 
) [static]

Definition at line 212 of file leaky.cpp.

{
  struct stat sb;
  if (fstat(fd, &sb) < 0) {
    perror("fstat");
    exit(-1);
  }
  void* base = mmap(0, (int)sb.st_size, flags, MAP_PRIVATE, fd, 0);
  if (!base) {
    perror("mmap");
    exit(-1);
  }
  *sz = sb.st_size;
  return base;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static ptrdiff_t symbolOrder ( void const a,
void const b 
) [static]

Definition at line 288 of file leaky.cpp.

{
  Symbol const* ap = (Symbol const *)a;
  Symbol const* bp = (Symbol const *)b;
  return ap->address - bp->address;
}

Here is the caller graph for this function:


Variable Documentation

const u_int DefaultBuckets = 10007 [static]

Definition at line 63 of file leaky.cpp.

const u_int MaxBuckets = 1000003 [static]

Definition at line 64 of file leaky.cpp.

char* typeFromLog[]
Initial value:
 {
    "malloc",
    "realloc",
    "free",
    "new",
    "delete",
    "addref",
    "release"
}

Definition at line 410 of file leaky.cpp.