pintos/src/prep/test_mem.c File Reference

#include <stdio.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <list.h>
#include <debug.h>
#include "memalloc.h"

Go to the source code of this file.

Defines

#define ROUNDS   1000
#define NPTRS   256
#define ALLOCSIZE   (256*3)
#define NTHREADS   5
#define MEMSIZE   (1<<16)

Functions

void exit (int)
int rand_r (unsigned int *)
static void check_and_free (uint8_t **ptr, size_t sz)
static void allocate_and_set (uint8_t **ptr, size_t sz)
static void * test_single (void *arg)
static void check_free_list_size ()
static int basic_tests ()
int main (int ac, char *av[])
void debug_panic (const char *file, int line, const char *function, const char *message,...)

Variables

static long long leftfence
static uint8_t memory [MEMSIZE]
static long long rightfence


Define Documentation

#define ALLOCSIZE   (256*3)

Definition at line 24 of file test_mem.c.

Referenced by test_single().

#define MEMSIZE   (1<<16)

Definition at line 27 of file test_mem.c.

Referenced by basic_tests().

#define NPTRS   256

Definition at line 23 of file test_mem.c.

Referenced by test_single().

#define NTHREADS   5

Definition at line 25 of file test_mem.c.

Referenced by main().

#define ROUNDS   1000

Definition at line 22 of file test_mem.c.

Referenced by test_single().


Function Documentation

static void allocate_and_set ( uint8_t **  ptr,
size_t  sz 
) [static]

Definition at line 56 of file test_mem.c.

References mem_alloc(), and NULL.

Referenced by test_single().

static int basic_tests (  )  [static]

Definition at line 153 of file test_mem.c.

References ASSERT, check_free_list_size(), mem_alloc(), mem_free(), MEMSIZE, and NULL.

Referenced by main().

static void check_and_free ( uint8_t **  ptr,
size_t  sz 
) [static]

Definition at line 40 of file test_mem.c.

References ASSERT, mem_free(), NULL, and s.

Referenced by test_single().

static void check_free_list_size (  )  [static]

Definition at line 129 of file test_mem.c.

References exit(), mem_sizeof_free_list(), and printf().

Referenced by basic_tests(), and main().

void debug_panic ( const char *  file,
int  line,
const char *  function,
const char *  message,
  ... 
)

Definition at line 250 of file test_mem.c.

References exit(), printf(), va_end, va_start, and vprintf().

void exit ( int   ) 

int main ( int  ac,
char *  av[] 
)

int rand_r ( unsigned int *   ) 

Referenced by test_single().

static void* test_single ( void *  arg  )  [static]

Definition at line 77 of file test_mem.c.

References allocate_and_set(), ALLOCSIZE, check_and_free(), memset(), NPTRS, NULL, rand_r(), and ROUNDS.

Referenced by main().


Variable Documentation

long long leftfence [static]

Definition at line 28 of file test_mem.c.

Referenced by main().

uint8_t memory[MEMSIZE] [static]

Definition at line 29 of file test_mem.c.

Referenced by main().

long long rightfence [static]

Definition at line 30 of file test_mem.c.

Referenced by main().


Generated on Mon Jan 10 16:43:58 2011 for Pintos by  doxygen 1.5.6