Changeset 637
- Timestamp:
- May 11, 2011, 1:26:19 AM (11 years ago)
- Location:
- abuse/trunk/src/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/lisp/lisp.cpp
r636 r637 54 54 int print_level = 0, trace_level = 0, trace_print_level = 1000; 55 55 int total_user_functions; 56 static int evaldepth = 0, maxevaldepth = 0; 56 57 57 58 int break_level=0; … … 3055 3056 PtrRef ref1(this); 3056 3057 3058 maxevaldepth = Max(maxevaldepth, ++evaldepth); 3059 3057 3060 int tstart = trace_level; 3058 3061 … … 3120 3123 Lisp::CollectSpace(&LSpace::Perm); 3121 3124 ret=l_user_stack.pop(1); */ 3125 --evaldepth; 3122 3126 3123 3127 return ret; -
abuse/trunk/src/lisp/lisp_gc.cpp
r636 r637 16 16 #include <string.h> 17 17 18 #include "common.h" 19 18 20 #include "lisp.h" 19 21 #include "lisp_gc.h" … … 40 42 41 43 static uint8_t *cstart, *cend, *collected_start, *collected_end; 44 static int gcdepth, maxgcdepth; 42 45 43 46 LArray *Lisp::CollectArray(LArray *x) … … 83 86 { 84 87 LObject *ret = x; 88 89 maxgcdepth = Max(maxgcdepth, ++gcdepth); 85 90 86 91 if ((uint8_t *)x >= cstart && (uint8_t *)x < cend) … … 169 174 } 170 175 176 --gcdepth; 171 177 return ret; 172 178 } … … 207 213 void Lisp::CollectSpace(LSpace *which_space, int grow) 208 214 { 209 LSpace *old_space = LSpace::Current; 215 LSpace *sp = LSpace::Current; 216 217 maxgcdepth = gcdepth = 0; 218 210 219 cstart = which_space->m_data; 211 220 cend = which_space->m_free; 212 213 221 LSpace::Gc.m_size = which_space->m_size; 214 222 if (grow) … … 227 235 CollectStacks(); 228 236 229 // for debuging clear it out230 memset(which_space->m_data, 0, which_space->m_size);231 237 free(which_space->m_data); 232 233 238 which_space->m_data = new_data; 234 239 which_space->m_size = LSpace::Gc.m_size; 235 240 which_space->m_free = new_data + (LSpace::Gc.m_free - LSpace::Gc.m_data); 236 LSpace::Current = old_space; 237 } 238 241 242 LSpace::Current = sp; 243 } 244
Note: See TracChangeset
for help on using the changeset viewer.