source: abuse/branches/pd/abuse/inc/lisp_gc.hpp @ 483

Last change on this file since 483 was 49, checked in by Sam Hocevar, 15 years ago
  • Imported original public domain release, for future reference.
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.