tlds
Transactional Operations for Linked Data Structures
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <unistd.h>
#include "portable_defns.h"
#include "gc.h"
Classes | |
struct | chunk_st |
struct | gc_global_st |
struct | gc_st |
Macros | |
#define | INVALID_BYTE 0 |
#define | INITIALISE_NODES(_p, _c) memset((_p), INVALID_BYTE, (_c)); |
#define | MAX_SIZES 20 |
#define | MAX_HOOKS 4 |
#define | ALLOC_CHUNKS_PER_LIST 10 |
#define | ENTRIES_PER_RECLAIM_ATTEMPT 100 |
#define | NR_EPOCHS 3 |
#define | BLKS_PER_CHUNK 100 |
#define | MEM_FAIL(_s) |
#define | CHUNKS_PER_ALLOC 1000 |
#define | gc_async_barrier(_g) ((void)0) |
Typedefs | |
typedef struct chunk_st | chunk_t |
Functions | |
static chunk_t * | alloc_more_chunks (void) |
static void | add_chunks_to_list (chunk_t *ch, chunk_t *head) |
static chunk_t * | get_empty_chunks (int n) |
static chunk_t * | get_filled_chunks (int n, int sz) |
static chunk_t * | get_alloc_chunk (gc_t *gc, int i) |
static void | gc_reclaim (void) |
void * | fr_gc_alloc (ptst_t *ptst, int alloc_id) |
static chunk_t * | chunk_from_cache (gc_t *gc) |
void | fr_gc_free (ptst_t *ptst, void *p, int alloc_id) |
void | fr_gc_add_ptr_to_hook_list (ptst_t *ptst, void *ptr, int hook_id) |
void | fr_gc_unsafe_free (ptst_t *ptst, void *p, int alloc_id) |
void | fr_gc_enter (ptst_t *ptst) |
void | fr_gc_exit (ptst_t *ptst) |
gc_t * | fr_gc_init (void) |
int | fr_gc_add_allocator (int alloc_size) |
void | fr_gc_remove_allocator (int alloc_id) |
int | fr_gc_add_hook (hook_fn_t fn) |
void | fr_gc_remove_hook (int hook_id) |
void | fr_destroy_gc_subsystem (void) |
void | fr_init_gc_subsystem (void) |
Variables | |
static struct gc_global_st | gc_global |
#define ALLOC_CHUNKS_PER_LIST 10 |
#define BLKS_PER_CHUNK 100 |
#define CHUNKS_PER_ALLOC 1000 |
#define ENTRIES_PER_RECLAIM_ATTEMPT 100 |
#define gc_async_barrier | ( | _g | ) | ((void)0) |
#define INITIALISE_NODES | ( | _p, | |
_c | |||
) | memset((_p), INVALID_BYTE, (_c)); |
#define INVALID_BYTE 0 |
#define MAX_HOOKS 4 |
#define MAX_SIZES 20 |
#define MEM_FAIL | ( | _s | ) |
#define NR_EPOCHS 3 |
|
static |
void fr_destroy_gc_subsystem | ( | void | ) |
int fr_gc_add_allocator | ( | int | alloc_size | ) |
int fr_gc_add_hook | ( | hook_fn_t | fn | ) |
void fr_gc_add_ptr_to_hook_list | ( | ptst_t * | ptst, |
void * | ptr, | ||
int | hook_id | ||
) |
void* fr_gc_alloc | ( | ptst_t * | ptst, |
int | alloc_id | ||
) |
void fr_gc_enter | ( | ptst_t * | ptst | ) |
void fr_gc_exit | ( | ptst_t * | ptst | ) |
void fr_gc_free | ( | ptst_t * | ptst, |
void * | p, | ||
int | alloc_id | ||
) |
gc_t* fr_gc_init | ( | void | ) |
void fr_gc_remove_allocator | ( | int | alloc_id | ) |
void fr_gc_remove_hook | ( | int | hook_id | ) |
void fr_gc_unsafe_free | ( | ptst_t * | ptst, |
void * | p, | ||
int | alloc_id | ||
) |
void fr_init_gc_subsystem | ( | void | ) |
|
static |
|
static |
|
static |
|
static |