Changeset 554
- Timestamp:
- Apr 29, 2011, 1:39:32 AM (12 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/game.cpp
r544 r554 2468 2468 2469 2469 game_net_init(argc, argv); 2470 lisp_init(0x8000 0, 0x94000);2470 lisp_init(0x8000, 0x94000); 2471 2471 2472 2472 dev_init(argc, argv); -
abuse/trunk/src/lisp/lisp.cpp
r524 r554 188 188 { 189 189 if (which_space == PERM_SPACE || which_space == TMP_SPACE) 190 collect_space(which_space); 190 collect_space(which_space, 0); 191 192 if (size > get_free_size(which_space)) 193 collect_space(which_space, 1); 191 194 192 195 if (size > get_free_size(which_space)) … … 2818 2821 } 2819 2822 case SYS_FUNC_GC: 2820 collect_space(current_space );2823 collect_space(current_space, 0); 2821 2824 break; 2822 2825 case SYS_FUNC_SCHAR: -
abuse/trunk/src/lisp/lisp_gc.cpp
r553 r554 233 233 } 234 234 235 void collect_space(int which_space ) // should be tmp or permanent235 void collect_space(int which_space, int grow) // should be tmp or permanent 236 236 { 237 237 int old_space = current_space; … … 240 240 241 241 space_size[GC_SPACE] = space_size[which_space]; 242 if (grow) 243 { 244 space_size[GC_SPACE] += space_size[which_space] >> 1; 245 space_size[GC_SPACE] -= (space_size[GC_SPACE] & 7); 246 } 242 247 uint8_t *new_space = (uint8_t *)malloc(space_size[GC_SPACE]); 243 248 current_space = GC_SPACE; … … 255 260 256 261 space[which_space] = new_space; 262 space_size[which_space] = space_size[GC_SPACE]; 257 263 free_space[which_space] = new_space 258 264 + (free_space[GC_SPACE] - space[GC_SPACE]); -
abuse/trunk/src/lisp/lisp_gc.h
r496 r554 15 15 extern grow_stack<void> l_user_stack; // stack user progs can push data and have it GCed 16 16 17 void collect_space(int which_space ); // should be tmp or permenant17 void collect_space(int which_space, int grow); // should be tmp or permenant 18 18 19 19 void register_pointer(void *&addr);
Note: See TracChangeset
for help on using the changeset viewer.