1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c (heaps_slot, assign_heap_slot, gc_sweep): skip sweep if

heap_slot's status is pre-free phase.  [ruby-dev:41543]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tarui 2010-06-06 14:46:39 +00:00
parent ce4a6e685d
commit dd4b718457
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Sun Jun 6 23:35:12 2010 Masaya Tarui <tarui@ruby-lnag.org>
* gc.c (heaps_slot, assign_heap_slot, gc_sweep): skip sweep if
heap_slot's status is pre-free phase. [ruby-dev:41543]
Sun Jun 6 22:37:11 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* string.c (rb_str_buf_cat_escaped_char): get rid of buffer

6
gc.c
View file

@ -280,6 +280,7 @@ struct heaps_slot {
void *membase;
RVALUE *slot;
size_t limit;
int finalize_flag;
};
#define HEAP_MIN_SLOTS 10000
@ -938,6 +939,7 @@ assign_heap_slot(rb_objspace_t *objspace)
heaps[hi].membase = membase;
heaps[hi].slot = p;
heaps[hi].limit = objs;
heaps[hi].finalize_flag = FALSE;
pend = p + objs;
if (lomem == 0 || lomem > p) lomem = p;
if (himem < pend) himem = pend;
@ -1874,6 +1876,8 @@ gc_sweep(rb_objspace_t *objspace)
RVALUE *final = final_list;
int deferred;
if(heaps[i].finalize_flag) continue;
p = heaps[i].slot; pend = p + heaps[i].limit;
while (p < pend) {
if (!(p->as.basic.flags & FL_MARK)) {
@ -1912,7 +1916,7 @@ gc_sweep(rb_objspace_t *objspace)
pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
}
heaps[i].limit = final_num;
heaps[i].finalize_flag = TRUE;
freelist = free; /* cancel this page from freelist */
}
else {