tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gc.h
Go to the documentation of this file.
1 #ifndef __GC_H__
2 #define __GC_H__
3 
4 typedef struct gc_st gc_t;
5 
6 /* Most of these functions peek into a per-thread state struct. */
7 #include "ptst.h"
8 
9 /* Initialise GC section of given per-thread state structure. */
10 gc_t *fr_gc_init(void);
11 
12 int fr_gc_add_allocator(int alloc_size);
13 void fr_gc_remove_allocator(int alloc_id);
14 
15 /*
16  * Memory allocate/free. An unsafe free can be used when an object was
17  * not made visible to other processes.
18  */
19 void *fr_gc_alloc(ptst_t *ptst, int alloc_id);
20 void fr_gc_free(ptst_t *ptst, void *p, int alloc_id);
21 void fr_gc_unsafe_free(ptst_t *ptst, void *p, int alloc_id);
22 
23 /*
24  * Hook registry. Allows users to hook in their own per-epoch delay
25  * lists.
26  */
27 typedef void (*hook_fn_t)(ptst_t *, void *);
29 void fr_gc_remove_hook(int hook_id);
30 void fr_gc_add_ptr_to_hook_list(ptst_t *ptst, void *ptr, int hook_id);
31 
32 /* Per-thread entry/exit from critical regions */
33 void fr_gc_enter(ptst_t *ptst);
34 void fr_gc_exit(ptst_t *ptst);
35 
36 /* Start-of-day initialisation of garbage collector. */
37 void fr_init_gc_subsystem(void);
38 void fr_destroy_gc_subsystem(void);
39 
40 #endif /* __GC_H__ */
void fr_gc_unsafe_free(ptst_t *ptst, void *p, int alloc_id)
Definition: gc.c:509
void *volatile ptr
Definition: counted_ptr.hpp:57
void fr_gc_remove_allocator(int alloc_id)
Definition: gc.c:619
void(* hook_fn_t)(ptst_t *, void *)
Definition: gc.h:27
int fr_gc_add_allocator(int alloc_size)
Definition: gc.c:608
Definition: ptst.h:17
void fr_gc_exit(ptst_t *ptst)
Definition: gc.c:568
ptst_t * ptst
Definition: stmskip.cc:244
gc_t * fr_gc_init(void)
Definition: gc.c:575
void fr_destroy_gc_subsystem(void)
Definition: gc.c:640
void * fr_gc_alloc(ptst_t *ptst, int alloc_id)
Definition: gc.c:411
void fr_gc_free(ptst_t *ptst, void *p, int alloc_id)
Definition: gc.c:458
void fr_gc_add_ptr_to_hook_list(ptst_t *ptst, void *ptr, int hook_id)
Definition: gc.c:484
Definition: gc.c:133
struct @18 p
void fr_gc_enter(ptst_t *ptst)
Definition: gc.c:526
int fr_gc_add_hook(hook_fn_t fn)
Definition: gc.c:625
void fr_gc_remove_hook(int hook_id)
Definition: gc.c:634
void fr_init_gc_subsystem(void)
Definition: gc.c:650