Changeset 635
- Timestamp:
- May 11, 2011, 1:26:11 AM (11 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/cache.cpp
r555 r635 382 382 if (cache_fun) 383 383 { 384 int sp=current_space;385 current_space=PERM_SPACE;384 LSpace *sp = LSpace::Current; 385 LSpace::Current = &LSpace::Perm; 386 386 387 387 void *call_with=NULL; … … 419 419 } 420 420 } 421 current_space=sp;421 LSpace::Current=sp; 422 422 423 423 } -
abuse/trunk/src/chars.cpp
r555 r635 113 113 num=ts; 114 114 if (num<MAX_STATE) num=MAX_STATE; 115 int sp=current_space;116 current_space=PERM_SPACE;115 LSpace *sp = LSpace::Current; 116 LSpace::Current = &LSpace::Perm; 117 117 ((LSymbol *)symbol)->SetNumber(num); 118 current_space=sp;118 LSpace::Current=sp; 119 119 } 120 120 … … 268 268 269 269 /* create the var and add to var list */ 270 int sp=current_space;271 current_space=PERM_SPACE;270 LSpace *sp = LSpace::Current; 271 LSpace::Current = &LSpace::Perm; 272 272 273 273 add_c_object(symbol,free_index); … … 276 276 var_index[free_index]=tv; 277 277 tv++; 278 current_space=sp;278 LSpace::Current=sp; 279 279 } 280 280 } -
abuse/trunk/src/clisp.cpp
r579 r635 724 724 for (int x=0; x<trials; x++) 725 725 { 726 clear_tmp();726 LSpace::Tmp.Clear(); 727 727 CAR(args)->Eval(); 728 728 } … … 770 770 exit(0); 771 771 } 772 int sp=current_space;773 current_space=PERM_SPACE;772 LSpace *sp = LSpace::Current; 773 LSpace::Current = &LSpace::Perm; 774 774 sym->SetNumber(total_objects); // set the symbol value to the object number 775 current_space=sp;775 LSpace::Current=sp; 776 776 if (!total_objects) 777 777 { … … 1382 1382 } 1383 1383 1384 int sp=current_space;1385 current_space=PERM_SPACE;1384 LSpace *sp = LSpace::Current; 1385 LSpace::Current = &LSpace::Perm; 1386 1386 int id=cache.reg(lstring_value(lcar(args)),NULL,SPEC_EXTERN_SFX,1); 1387 1387 if (sym) 1388 1388 sym->SetNumber(id); // set the symbol value to sfx id 1389 current_space=sp;1389 LSpace::Current=sp; 1390 1390 return id; 1391 1391 } break; -
abuse/trunk/src/dev.cpp
r579 r635 53 53 54 54 // maybe english.lsp was not loaded yet, let's try to do that 55 int sp=current_space; 56 current_space=PERM_SPACE; 57 55 LSpace *sp = LSpace::Current; 56 LSpace::Current = &LSpace::Perm; 58 57 59 58 char prog[50]; … … 68 67 exit(0); 69 68 } 70 current_space=sp;69 LSpace::Current=sp; 71 70 72 71 -
abuse/trunk/src/game.cpp
r632 r635 699 699 { 700 700 screen->dirt_off(); 701 clear_tmp();701 LSpace::Tmp.Clear(); 702 702 l_post_render->EvalFunction(NULL); 703 clear_tmp();703 LSpace::Tmp.Clear(); 704 704 screen->dirt_on(); 705 705 } … … 1985 1985 void Game::step() 1986 1986 { 1987 clear_tmp();1987 LSpace::Tmp.Clear(); 1988 1988 if(current_level) 1989 1989 { … … 2282 2282 if(!strcmp(argv[i], "-lisp")) 2283 2283 { 2284 lisp_init();2284 Lisp::Init(); 2285 2285 char const *eof_char = "Ctrl-D"; 2286 2286 fprintf(stderr, … … 2328 2328 /* if(DEFINEDP(symbol_function(l_next_song))) // if user function installed, call it to load up next song 2329 2329 { 2330 int sp = current_space;2331 current_space = PERM_SPACE;2330 int sp = LSpace::Current; 2331 LSpace::Current = SPACE_PERM; 2332 2332 ((LSymbol *)l_next_song)->EvalFunction(NULL); 2333 current_space= sp;2333 LSpace::Current = sp; 2334 2334 } */ 2335 2335 } … … 2459 2459 2460 2460 game_net_init(argc, argv); 2461 lisp_init();2461 Lisp::Init(); 2462 2462 2463 2463 dev_init(argc, argv); … … 2588 2588 } 2589 2589 2590 lisp_uninit();2590 Lisp::Uninit(); 2591 2591 2592 2592 #if !defined __CELLOS_LV2__ -
abuse/trunk/src/gamma.cpp
r632 r635 189 189 fprintf(fp, "(setq darkest_gray %ld)\n", dg); 190 190 fclose(fp); 191 int sp = current_space;192 current_space = PERM_SPACE;191 LSpace *sp = LSpace::Current; 192 LSpace::Current = &LSpace::Perm; 193 193 LSymbol::FindOrCreate("darkest_gray")->SetNumber(dg); 194 194 195 current_space= sp;195 LSpace::Current = sp; 196 196 } 197 197 else -
abuse/trunk/src/level.cpp
r555 r635 743 743 } 744 744 745 clear_tmp();745 LSpace::Tmp.Clear(); 746 746 747 747 if (cur) … … 822 822 } 823 823 824 clear_tmp();824 LSpace::Tmp.Clear(); 825 825 } 826 826 … … 941 941 uint16_t t=fp->read_uint16(); 942 942 game_object *p=new game_object(o_remap[t],1); 943 clear_tmp();943 LSpace::Tmp.Clear(); 944 944 if (!first) first=p; else last->next=p; 945 945 last=p; p->next=NULL; … … 1151 1151 uint16_t t=fp->read_uint16(); 1152 1152 game_object *p=new game_object(o_remap[t],1); 1153 clear_tmp();1153 LSpace::Tmp.Clear(); 1154 1154 if (!first) first=p; else last->next=p; 1155 1155 last=p; p->next=NULL; … … 1510 1510 /* if (DEFINEDP(symbol_function(l_level_loaded))) 1511 1511 { 1512 int sp=current_space;1513 current_space=PERM_SPACE;1512 LSpace *sp = LSpace::Current; 1513 LSpace::Current = &LSpace::Perm; 1514 1514 1515 1515 void *arg_list=NULL; … … 1518 1518 ((LSymbol *)l_level_loaded)->EvalFunction(arg_list); 1519 1519 1520 current_space=sp;1520 LSpace::Current = sp; 1521 1521 } */ 1522 1522 } … … 1841 1841 if (f->focus) 1842 1842 { 1843 current_object =f->focus;1844 void *m =mark_heap(TMP_SPACE);1843 current_object = f->focus; 1844 void *m = LSpace::Tmp.Mark(); 1845 1845 fun->EvalFunction(NULL); 1846 restore_heap(m,TMP_SPACE);1846 LSpace::Tmp.Restore(m); 1847 1847 } 1848 1848 } -
abuse/trunk/src/lisp/lisp.cpp
r563 r635 42 42 * tmp space which gets thrown away after completion of eval. system 43 43 * functions reside in permant space. */ 44 45 bFILE *current_print_file=NULL; 44 LSpace LSpace::Tmp, LSpace::Perm, LSpace::Gc; 45 46 /* Normally set to Tmp, unless compiling or other needs. */ 47 LSpace *LSpace::Current; 48 49 bFILE *current_print_file = NULL; 46 50 47 51 LSymbol *LSymbol::root = NULL; 48 52 size_t LSymbol::count = 0; 49 53 50 51 uint8_t *space[4], *free_space[4];52 size_t space_size[4];53 54 int print_level = 0, trace_level = 0, trace_print_level = 1000; 54 55 int total_user_functions; 55 56 int current_space; // normally set to TMP_SPACE, unless compiling or other needs57 56 58 57 int break_level=0; … … 160 159 void need_perm_space(char const *why) 161 160 { 162 if ( current_space!=PERM_SPACE && current_space!=GC_SPACE)161 if (LSpace::Current != &LSpace::Perm && LSpace::Current != &LSpace::Gc) 163 162 { 164 163 lbreak("%s : action requires permanant space\n", why); … … 167 166 } 168 167 169 void * mark_heap(int heap)170 { 171 return free_space[heap];172 } 173 174 void restore_heap(void *val, int heap)175 { 176 free_space[heap]= (uint8_t *)val;177 } 178 179 s tatic size_t get_free_size(int which_space)180 { 181 size_t used = free_space[which_space] - space[which_space];182 return space_size[which_space] > used ? space_size[which_space]- used : 0;183 } 184 185 static void *lmalloc(size_t size, int which_space)168 void *LSpace::Mark() 169 { 170 return m_free; 171 } 172 173 void LSpace::Restore(void *val) 174 { 175 m_free = (uint8_t *)val; 176 } 177 178 size_t LSpace::GetFree() 179 { 180 size_t used = m_free - m_data; 181 return m_size > used ? m_size - used : 0; 182 } 183 184 void *LSpace::Alloc(size_t size) 186 185 { 187 186 // Align allocation … … 189 188 190 189 // Collect garbage if necessary 191 if (size > get_free_size(which_space)) 192 { 193 if (which_space == PERM_SPACE || which_space == TMP_SPACE) 194 LispGC::CollectSpace(which_space, 0); 195 196 if (size > get_free_size(which_space)) 197 LispGC::CollectSpace(which_space, 1); 198 199 if (size > get_free_size(which_space)) 200 { 201 lbreak("lisp: cannot find %d bytes in space #%d\n", 202 size, which_space); 190 if (size > GetFree()) 191 { 192 if (this == &LSpace::Perm || this == &LSpace::Tmp) 193 LispGC::CollectSpace(this, 0); 194 195 if (size > GetFree()) 196 LispGC::CollectSpace(this, 1); 197 198 if (size > GetFree()) 199 { 200 lbreak("lisp: cannot find %d bytes in %s\n", size, m_name); 203 201 exit(0); 204 202 } 205 203 } 206 204 207 void *ret = (void *)free_space[which_space];208 free_space[which_space]+= size;205 void *ret = m_free; 206 m_free += size; 209 207 return ret; 210 208 } … … 229 227 size = sizeof(LRedirect); 230 228 231 LArray *p = (LArray *) lmalloc(size, current_space);229 LArray *p = (LArray *)LSpace::Current->Alloc(size); 232 230 p->type = L_1D_ARRAY; 233 231 p->len = len; … … 282 280 size_t size = Max(sizeof(LFixedPoint), sizeof(LRedirect)); 283 281 284 LFixedPoint *p = (LFixedPoint *) lmalloc(size, current_space);282 LFixedPoint *p = (LFixedPoint *)LSpace::Current->Alloc(size); 285 283 p->type = L_FIXED_POINT; 286 284 p->x = x; … … 292 290 size_t size = Max(sizeof(LObjectVar), sizeof(LRedirect)); 293 291 294 LObjectVar *p = (LObjectVar *) lmalloc(size, current_space);292 LObjectVar *p = (LObjectVar *)LSpace::Current->Alloc(size); 295 293 p->type = L_OBJECT_VAR; 296 294 p->index = index; … … 304 302 size_t size = Max(sizeof(LPointer), sizeof(LRedirect)); 305 303 306 LPointer *p = (LPointer *) lmalloc(size, current_space);304 LPointer *p = (LPointer *)LSpace::Current->Alloc(size); 307 305 p->type = L_POINTER; 308 306 p->addr = addr; … … 314 312 size_t size = Max(sizeof(LChar), sizeof(LRedirect)); 315 313 316 LChar *c = (LChar *) lmalloc(size, current_space);314 LChar *c = (LChar *)LSpace::Current->Alloc(size); 317 315 c->type = L_CHARACTER; 318 316 c->ch = ch; … … 339 337 size_t size = Max(sizeof(LString) + length - 1, sizeof(LRedirect)); 340 338 341 LString *s = (LString *) lmalloc(size, current_space);339 LString *s = (LString *)LSpace::Current->Alloc(size); 342 340 s->type = L_STRING; 343 341 s->str[0] = '\0'; … … 351 349 size_t size = Max(sizeof(LUserFunction), sizeof(LRedirect)); 352 350 353 LUserFunction *lu = (LUserFunction *) lmalloc(size, current_space);351 LUserFunction *lu = (LUserFunction *)LSpace::Current->Alloc(size); 354 352 lu->type = L_USER_FUNCTION; 355 353 lu->arg_list = arg_list; … … 363 361 364 362 // System functions should reside in permanant space 365 int space = (current_space == GC_SPACE) ? GC_SPACE : PERM_SPACE; 366 LSysFunction *ls = (LSysFunction *)lmalloc(size, space); 363 LSysFunction *ls = LSpace::Current == &LSpace::Gc 364 ? (LSysFunction *)LSpace::Gc.Alloc(size) 365 : (LSysFunction *)LSpace::Perm.Alloc(size); 367 366 ls->type = L_SYS_FUNCTION; 368 367 ls->min_args = min_args; … … 397 396 size_t size = Max(sizeof(LSymbol), sizeof(LRedirect)); 398 397 399 LSymbol *s = (LSymbol *) lmalloc(size, current_space);398 LSymbol *s = (LSymbol *)LSpace::Current->Alloc(size); 400 399 PtrRef ref(s); 401 400 … … 414 413 size_t size = Max(sizeof(LNumber), sizeof(LRedirect)); 415 414 416 LNumber *n = (LNumber *) lmalloc(size, current_space);415 LNumber *n = (LNumber *)LSpace::Current->Alloc(size); 417 416 n->type = L_NUMBER; 418 417 n->num = num; … … 424 423 size_t size = Max(sizeof(LList), sizeof(LRedirect)); 425 424 426 LList *c = (LList *) lmalloc(size, current_space);425 LList *c = (LList *)LSpace::Current->Alloc(size); 427 426 c->type = L_CONS_CELL; 428 427 c->car = NULL; … … 772 771 else 773 772 { 774 int sp=current_space;775 if ( current_space!=GC_SPACE)776 current_space=PERM_SPACE; // make sure all symbols get defined in permanant space773 LSpace *sp = LSpace::Current; 774 if (LSpace::Current != &LSpace::Gc) 775 LSpace::Current = &LSpace::Perm; // make sure all symbols get defined in permanant space 777 776 LList *cs; 778 777 cs=LList::Create(); … … 781 780 cs->cdr=symbol_list; 782 781 symbol_list=cs; 783 current_space=sp;782 LSpace::Current = sp; 784 783 } 785 784 return s; … … 815 814 816 815 // Make sure all symbols get defined in permanant space 817 int sp = current_space;818 if ( current_space != GC_SPACE)819 current_space = PERM_SPACE;816 LSpace *sp = LSpace::Current; 817 if (LSpace::Current != &LSpace::Gc) 818 LSpace::Current = &LSpace::Perm; 820 819 821 820 p = (LSymbol *)malloc(sizeof(LSymbol)); … … 833 832 count++; 834 833 835 current_space= sp;834 LSpace::Current = sp; 836 835 return p; 837 836 } … … 2401 2400 stat_man->update((cs - s) * 100 / l); 2402 2401 #endif 2403 void *m = mark_heap(TMP_SPACE);2402 void *m = LSpace::Tmp.Mark(); 2404 2403 compiled_form = LObject::Compile(cs); 2405 2404 compiled_form->Eval(); 2406 2405 compiled_form = NULL; 2407 restore_heap(m, TMP_SPACE);2406 LSpace::Tmp.Restore(m); 2408 2407 } 2409 2408 #ifndef NO_LIBS … … 2471 2470 case SYS_FUNC_ENUM: 2472 2471 { 2473 int sp = current_space;2474 current_space = PERM_SPACE;2472 LSpace *sp = LSpace::Current; 2473 LSpace::Current = &LSpace::Perm; 2475 2474 int32_t x = 0; 2476 2475 while (arg_list) … … 2511 2510 x++; 2512 2511 } 2513 current_space= sp;2512 LSpace::Current = sp; 2514 2513 break; 2515 2514 } … … 2807 2806 } 2808 2807 case SYS_FUNC_GC: 2809 LispGC::CollectSpace( current_space, 0);2808 LispGC::CollectSpace(LSpace::Current, 0); 2810 2809 break; 2811 2810 case SYS_FUNC_SCHAR: … … 2946 2945 void tmp_space() 2947 2946 { 2948 current_space = TMP_SPACE;2947 LSpace::Current = &LSpace::Tmp; 2949 2948 } 2950 2949 2951 2950 void perm_space() 2952 2951 { 2953 current_space = PERM_SPACE; 2954 } 2955 2956 void use_user_space(void *addr, long size) 2957 { 2958 current_space = USER_SPACE; 2959 free_space[USER_SPACE] = space[USER_SPACE] = (uint8_t *)addr; 2960 space_size[USER_SPACE] = size; 2952 LSpace::Current = &LSpace::Perm; 2961 2953 } 2962 2954 … … 3071 3063 { 3072 3064 dprintf("%d (%d, %d, %d) TRACE : ", trace_level, 3073 get_free_size(PERM_SPACE), get_free_size(TMP_SPACE),3065 LSpace::Perm.GetFree(), LSpace::Tmp.GetFree(), 3074 3066 PtrRef::stack.m_size); 3075 3067 Print(); … … 3120 3112 if (trace_level <= trace_print_level) 3121 3113 dprintf("%d (%d, %d, %d) TRACE ==> ", trace_level, 3122 get_free_size(PERM_SPACE), get_free_size(TMP_SPACE),3114 LSpace::Perm.GetFree(), LSpace::Tmp.GetFree(), 3123 3115 PtrRef::stack.m_size); 3124 3116 ret->Print(); … … 3127 3119 3128 3120 /* l_user_stack.push(ret); 3129 LispGC::CollectSpace( PERM_SPACE);3121 LispGC::CollectSpace(&LSpace::Perm); 3130 3122 ret=l_user_stack.pop(1); */ 3131 3123 … … 3135 3127 void l_comp_init(); 3136 3128 3137 void lisp_init()3129 void Lisp::Init() 3138 3130 { 3139 3131 LSymbol::root = NULL; 3140 3132 total_user_functions = 0; 3141 3133 3142 free_space[0] = space[0] = (uint8_t *)malloc(0x1000); 3143 space_size[0] = 0x1000; 3144 3145 free_space[1] = space[1] = (uint8_t *)malloc(0x1000); 3146 space_size[1] = 0x1000; 3147 3148 current_space = PERM_SPACE; 3134 LSpace::Tmp.m_free = LSpace::Tmp.m_data = (uint8_t *)malloc(0x1000); 3135 LSpace::Tmp.m_size = 0x1000; 3136 LSpace::Tmp.m_name = "temporary space"; 3137 3138 LSpace::Perm.m_free = LSpace::Perm.m_data = (uint8_t *)malloc(0x1000); 3139 LSpace::Perm.m_size = 0x1000; 3140 LSpace::Perm.m_name = "permanent space"; 3141 3142 LSpace::Gc.m_name = "garbage space"; 3143 3144 LSpace::Current = &LSpace::Perm; 3149 3145 3150 3146 l_comp_init(); … … 3153 3149 sys_funcs[i].min_args, sys_funcs[i].max_args, i); 3154 3150 clisp_init(); 3155 current_space = TMP_SPACE;3151 LSpace::Current = &LSpace::Tmp; 3156 3152 dprintf("Lisp: %d symbols defined, %d system functions, " 3157 3153 "%d pre-compiled functions\n", LSymbol::count, … … 3159 3155 } 3160 3156 3161 void lisp_uninit()3162 { 3163 free( space[0]);3164 free( space[1]);3157 void Lisp::Uninit() 3158 { 3159 free(LSpace::Tmp.m_data); 3160 free(LSpace::Perm.m_data); 3165 3161 DeleteAllSymbols(LSymbol::root); 3166 3162 LSymbol::root = NULL; … … 3168 3164 } 3169 3165 3170 void clear_tmp()3171 { 3172 free_space[TMP_SPACE] = space[TMP_SPACE];3166 void LSpace::Clear() 3167 { 3168 m_free = m_data; 3173 3169 } 3174 3170 -
abuse/trunk/src/lisp/lisp.h
r560 r635 21 21 #define Cell void 22 22 #define MAX_LISP_TOKEN_LEN 200 23 enum { PERM_SPACE,24 TMP_SPACE,25 USER_SPACE,26 GC_SPACE };27 23 28 24 #define FIXED_TRIG_SIZE 360 // 360 degrees stored in table … … 33 29 #define DEFINEDP(x) (x!=l_undefined) 34 30 class bFILE; 35 extern int current_space;36 31 extern bFILE *current_print_file; 37 32 … … 45 40 typedef uint32_t ltype; // make sure structures aren't packed differently on various compiler 46 41 // and sure that word, etc are word aligned 42 43 class Lisp 44 { 45 public: 46 static void Init(); 47 static void Uninit(); 48 }; 49 50 struct LSpace 51 { 52 size_t GetFree(); 53 void *Alloc(size_t size); 54 55 void *Mark(); 56 void Restore(void *val); 57 void Clear(); 58 59 static LSpace Tmp, Perm, Gc; 60 static LSpace *Current; 61 62 uint8_t *m_data; 63 uint8_t *m_free; 64 char const *m_name; 65 size_t m_size; 66 }; 47 67 48 68 struct LObject … … 206 226 void perm_space(); 207 227 void tmp_space(); 208 void use_user_space(void *addr, long size);209 228 void *lpointer_value(void *lpointer); 210 229 int32_t lnumber_value(void *lnumber); … … 239 258 240 259 int end_of_program(char *s); 241 void clear_tmp();242 260 void lisp_init(); 243 261 void lisp_uninit(); 244 262 245 extern uint8_t *space[4], *free_space[4];246 extern size_t space_size[4];247 263 void *nth(int num, void *list); 248 264 int32_t lisp_atan2(int32_t dy, int32_t dx); -
abuse/trunk/src/lisp/lisp_gc.cpp
r630 r635 205 205 } 206 206 207 void LispGC::CollectSpace( intwhich_space, int grow)208 { 209 int old_space = current_space;210 cstart = space[which_space];211 cend = free_space[which_space];212 213 space_size[GC_SPACE] = space_size[which_space];207 void LispGC::CollectSpace(LSpace *which_space, int grow) 208 { 209 LSpace *old_space = LSpace::Current; 210 cstart = which_space->m_data; 211 cend = which_space->m_free; 212 213 LSpace::Gc.m_size = which_space->m_size; 214 214 if (grow) 215 215 { 216 space_size[GC_SPACE] += space_size[which_space]>> 1;217 space_size[GC_SPACE] -= (space_size[GC_SPACE]& 7);218 } 219 uint8_t *new_ space = (uint8_t *)malloc(space_size[GC_SPACE]);220 current_space = GC_SPACE;221 free_space[GC_SPACE] = space[GC_SPACE] = new_space;222 223 collected_start = new_ space;224 collected_end = new_ space + space_size[GC_SPACE];216 LSpace::Gc.m_size += which_space->m_size >> 1; 217 LSpace::Gc.m_size -= (LSpace::Gc.m_size & 7); 218 } 219 uint8_t *new_data = (uint8_t *)malloc(LSpace::Gc.m_size); 220 LSpace::Current = &LSpace::Gc; 221 LSpace::Gc.m_free = LSpace::Gc.m_data = new_data; 222 223 collected_start = new_data; 224 collected_end = new_data + LSpace::Gc.m_size; 225 225 226 226 CollectSymbols(LSymbol::root); … … 228 228 229 229 // for debuging clear it out 230 memset(space[which_space], 0, space_size[which_space]); 231 free(space[which_space]); 232 233 space[which_space] = new_space; 234 space_size[which_space] = space_size[GC_SPACE]; 235 free_space[which_space] = new_space 236 + (free_space[GC_SPACE] - space[GC_SPACE]); 237 current_space = old_space; 238 } 239 230 memset(which_space->m_data, 0, which_space->m_size); 231 free(which_space->m_data); 232 233 which_space->m_data = new_data; 234 which_space->m_size = LSpace::Gc.m_size; 235 which_space->m_free = new_data + (LSpace::Gc.m_free - LSpace::Gc.m_data); 236 LSpace::Current = old_space; 237 } 238 -
abuse/trunk/src/lisp/lisp_gc.h
r561 r635 20 20 public: 21 21 // Collect temporary or permanent spaces 22 static void CollectSpace( intwhich_space, int grow);22 static void CollectSpace(LSpace *which_space, int grow); 23 23 24 24 private: -
abuse/trunk/src/loader2.cpp
r579 r635 361 361 } 362 362 compiled_init(); 363 clear_tmp();363 LSpace::Tmp.Clear(); 364 364 365 365 dprintf("Engine : Registering base graphics\n"); -
abuse/trunk/src/menu.cpp
r590 r635 389 389 if (!DEFINEDP(ss->GetValue())) 390 390 { 391 int sp=current_space;392 current_space=PERM_SPACE;391 LSpace *sp = LSpace::Current; 392 LSpace::Current = &LSpace::Perm; 393 393 // char *prog="((\"art/help.spe\" . \"sell2\")(\"art/help.spe\" . \"sell4\")(\"art/help.spe\" . \"sell3\")(\"art/fore/endgame.spe\" . \"credit\"))"; 394 394 // char *prog="((\"art/fore/endgame.spe\" . \"credit\") (\"art/help.spe\" . \"sell6\"))"; 395 395 char const *prog = "((\"art/fore/endgame.spe\" . \"credit\"))"; 396 396 ss->SetValue(LObject::Compile(prog)); 397 current_space=sp;397 LSpace::Current = sp; 398 398 } 399 399 -
abuse/trunk/src/objects.cpp
r555 r635 261 261 current_object=this; 262 262 263 void *m =mark_heap(TMP_SPACE);263 void *m = LSpace::Tmp.Mark(); 264 264 ((LSymbol *)ns)->EvalFunction(NULL); 265 restore_heap(m,TMP_SPACE);265 LSpace::Tmp.Restore(m); 266 266 267 267 current_object=o; … … 275 275 { 276 276 current_object = this; 277 void *m = mark_heap( TMP_SPACE);277 void *m = LSpace::Tmp.Mark(); 278 278 ((LSymbol *)ns)->EvalFunction(NULL); 279 restore_heap( m, TMP_SPACE);279 LSpace::Tmp.Restore(m); 280 280 } 281 281 else … … 410 410 411 411 current_object=this; 412 void *m =mark_heap(TMP_SPACE);412 void *m = LSpace::Tmp.Mark(); 413 413 414 414 time_marker *prof1=NULL; … … 424 424 } 425 425 426 restore_heap(m,TMP_SPACE);426 LSpace::Tmp.Restore(m); 427 427 428 428 if (keep_ai_info()) … … 484 484 current_object = this; 485 485 486 void *m = mark_heap(TMP_SPACE);486 void *m = LSpace::Tmp.Mark(); 487 487 488 488 am = LList::Create(); … … 528 528 } 529 529 530 restore_heap(m, TMP_SPACE);530 LSpace::Tmp.Restore(m); 531 531 532 532 current_object = o; … … 624 624 current_object=this; 625 625 626 void *m =mark_heap(TMP_SPACE);626 void *m = LSpace::Tmp.Mark(); 627 627 time_marker *prof1=NULL; 628 628 if (profiling()) … … 637 637 } 638 638 639 640 641 restore_heap(m,TMP_SPACE); 639 LSpace::Tmp.Restore(m); 642 640 643 641 } else drawer(); … … 651 649 current_object=this; 652 650 653 void *m =mark_heap(TMP_SPACE);651 void *m = LSpace::Tmp.Mark(); 654 652 time_marker *prof1=NULL; 655 653 if (profiling()) … … 664 662 } 665 663 666 restore_heap(m,TMP_SPACE); 667 664 LSpace::Tmp.Restore(m); 668 665 } 669 666 } … … 1157 1154 current_object=g; 1158 1155 1159 void *m =mark_heap(TMP_SPACE);1156 void *m = LSpace::Tmp.Mark(); 1160 1157 1161 1158 time_marker *prof1=NULL; … … 1171 1168 } 1172 1169 1173 1174 1175 restore_heap(m,TMP_SPACE); 1176 1177 current_object=o; 1170 LSpace::Tmp.Restore(m); 1171 current_object = o; 1178 1172 } 1179 1173 return g; … … 1222 1216 lcy->cdr = lb; 1223 1217 1224 void *m = mark_heap(TMP_SPACE);1218 void *m = LSpace::Tmp.Mark(); 1225 1219 1226 1220 time_marker *prof1 = NULL; … … 1236 1230 } 1237 1231 1238 restore_heap(m,TMP_SPACE);1232 LSpace::Tmp.Restore(m); 1239 1233 1240 1234 if (item_type(r)!=L_NUMBER) … … 1626 1620 current_object=this; 1627 1621 1628 void *m =mark_heap(TMP_SPACE);1622 void *m = LSpace::Tmp.Mark(); 1629 1623 1630 1624 time_marker *prof1=NULL; … … 1640 1634 } 1641 1635 1642 1643 restore_heap(m,TMP_SPACE); 1644 1645 current_object=o; 1646 } 1647 } 1636 LSpace::Tmp.Restore(m); 1637 current_object = o; 1638 } 1639 } -
abuse/trunk/src/particle.cpp
r555 r635 72 72 exit(0); 73 73 } 74 int sp=current_space;75 current_space=PERM_SPACE;74 LSpace *sp = LSpace::Current; 75 LSpace::Current = &LSpace::Perm; 76 76 sym->SetNumber(total_pseqs); // set the symbol value to the object number 77 current_space=sp;77 LSpace::Current = sp; 78 78 pseqs=(part_sequence **)realloc(pseqs,sizeof(part_sequence *)*(total_pseqs+1)); 79 79 -
abuse/trunk/src/view.cpp
r555 r635 473 473 current_object=focus; 474 474 475 void *m =mark_heap(TMP_SPACE);475 void *m = LSpace::Tmp.Mark(); 476 476 void *list=NULL; 477 477 push_onto_list(LString::Create(chat_buf),list); 478 478 ((LSymbol *)l_chat_input)->EvalFunction(list); 479 restore_heap(m,TMP_SPACE);479 LSpace::Tmp.Restore(m); 480 480 481 481 current_object=o;
Note: See TracChangeset
for help on using the changeset viewer.