#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 ALLOCSIZE (256*3) |
| #define MEMSIZE (1<<16) |
| #define NPTRS 256 |
| #define NTHREADS 5 |
| #define ROUNDS 1000 |
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().
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, | |||
| ... | ||||
| ) |
| void exit | ( | int | ) |
Definition at line 72 of file syscall.c.
References NOT_REACHED, SYS_EXIT, and syscall1.
Referenced by _start(), check_free_list_size(), consume_some_resources_and_die(), debug_panic(), fail(), fail_io(), main(), relay(), test_main(), and usage().
| int main | ( | int | ac, | |
| char * | av[] | |||
| ) |
Definition at line 203 of file test_mem.c.
References ASSERT, basic_tests(), check_free_list_size(), exit(), leftfence, mem_init(), memory, NTHREADS, NULL, printf(), rightfence, and test_single().
| 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().
long long leftfence [static] |
long long rightfence [static] |
1.5.6