00001 /* 00002 Copyright (C) 2011 Computer Sciences Department, 00003 University of Wisconsin -- Madison 00004 00005 ---------------------------------------------------------------------- 00006 00007 This file is part of Mnemosyne: Lightweight Persistent Memory, 00008 originally developed at the University of Wisconsin -- Madison. 00009 00010 Mnemosyne was originally developed primarily by Haris Volos 00011 with contributions from Andres Jaan Tack. 00012 00013 ---------------------------------------------------------------------- 00014 00015 Mnemosyne is free software; you can redistribute it and/or 00016 modify it under the terms of the GNU General Public License 00017 as published by the Free Software Foundation, version 2 00018 of the License. 00019 00020 Mnemosyne is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License 00026 along with this program; if not, write to the Free Software 00027 Foundation, Inc., 51 Franklin Street, Fifth Floor, 00028 Boston, MA 02110-1301, USA. 00029 00030 ### END HEADER ### 00031 */ 00032 00033 /* 00034 * File: 00035 * gc.h 00036 * Author(s): 00037 * Pascal Felber <pascal.felber@unine.ch> 00038 * Patrick Marlier <patrick.marlier@unine.ch> 00039 * Description: 00040 * Epoch-based garbage collector. 00041 * 00042 * Copyright (c) 2007-2009. 00043 * 00044 * This program is free software; you can redistribute it and/or 00045 * modify it under the terms of the GNU General Public License 00046 * as published by the Free Software Foundation, version 2 00047 * of the License. 00048 * 00049 * This program is distributed in the hope that it will be useful, 00050 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00051 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00052 * GNU General Public License for more details. 00053 */ 00054 00055 #ifndef _GC_H_ 00056 # define _GC_H_ 00057 00058 # include <stdlib.h> 00059 00060 # ifdef __cplusplus 00061 extern "C" { 00062 # endif 00063 00064 typedef uintptr_t gc_word_t; 00065 00066 void gc_init(gc_word_t (*epoch)()); 00067 void gc_exit(); 00068 00069 void gc_init_thread(); 00070 void gc_exit_thread(); 00071 00072 void gc_set_epoch(gc_word_t epoch); 00073 00074 void gc_free(void *addr, gc_word_t epoch); 00075 00076 void gc_cleanup(); 00077 00078 void gc_cleanup_all(); 00079 00080 void gc_reset(); 00081 00082 # ifdef __cplusplus 00083 } 00084 # endif 00085 00086 #endif /* _GC_H_ */