source: abuse/trunk/src/lisp/lisp_gc.h @ 483

Last change on this file since 483 was 483, checked in by Sam Hocevar, 11 years ago

lisp: move all array-related functions to the LispArray? struct.

  • Property svn:keywords set to Id
File size: 918 bytes
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#include "stack.h"
11#ifndef __LISP_GC_HPP_
12#define __LISP_GC_HPP_
13
14extern grow_stack<void> l_user_stack;       // stack user progs can push data and have it GCed
15extern grow_stack<void *>l_ptr_stack;      // stack of user pointers, user pointers get remapped on GC
16
17void collect_space(int which_space); // should be tmp or permenant
18
19void register_pointer(void *&addr);
20void unregister_pointer(void *&addr);
21
22class p_ref {
23  public :
24  p_ref(void *&ref) { l_ptr_stack.push(&ref); }
25  p_ref(LispObject *&ref) { l_ptr_stack.push((void **)&ref); }
26  p_ref(LispArray *&ref) { l_ptr_stack.push((void **)&ref); }
27  ~p_ref() { l_ptr_stack.pop(1); }
28} ;
29
30
31#endif
Note: See TracBrowser for help on using the repository browser.