source: abuse/trunk/src/include/lisp_gc.hpp @ 2

Last change on this file since 2 was 2, checked in by Sam Hocevar, 14 years ago
  • imported original 0.7.0 tarball
File size: 531 bytes
Line 
1#include "stack.hpp"
2#ifndef __LISP_GC_HPP_
3#define __LISP_GC_HPP_
4
5extern grow_stack<void> l_user_stack;       // stack user progs can push data and have it GCed
6extern grow_stack<void *>l_ptr_stack;      // stack of user pointers, user pointers get remapped on GC
7
8void collect_space(int which_space); // should be tmp or permenant
9
10void register_pointer(void *&addr);
11void unregister_pointer(void *&addr);
12
13class p_ref {
14  public :
15  p_ref(void *&ref) { l_ptr_stack.push(&ref); }
16  ~p_ref() { l_ptr_stack.pop(1); }
17} ;
18
19
20#endif
Note: See TracBrowser for help on using the repository browser.