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:
parent
ce4a6e685d
commit
dd4b718457
2 changed files with 10 additions and 1 deletions
|
@ -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>
|
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
|
* string.c (rb_str_buf_cat_escaped_char): get rid of buffer
|
||||||
|
|
6
gc.c
6
gc.c
|
@ -280,6 +280,7 @@ struct heaps_slot {
|
||||||
void *membase;
|
void *membase;
|
||||||
RVALUE *slot;
|
RVALUE *slot;
|
||||||
size_t limit;
|
size_t limit;
|
||||||
|
int finalize_flag;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define HEAP_MIN_SLOTS 10000
|
#define HEAP_MIN_SLOTS 10000
|
||||||
|
@ -938,6 +939,7 @@ assign_heap_slot(rb_objspace_t *objspace)
|
||||||
heaps[hi].membase = membase;
|
heaps[hi].membase = membase;
|
||||||
heaps[hi].slot = p;
|
heaps[hi].slot = p;
|
||||||
heaps[hi].limit = objs;
|
heaps[hi].limit = objs;
|
||||||
|
heaps[hi].finalize_flag = FALSE;
|
||||||
pend = p + objs;
|
pend = p + objs;
|
||||||
if (lomem == 0 || lomem > p) lomem = p;
|
if (lomem == 0 || lomem > p) lomem = p;
|
||||||
if (himem < pend) himem = pend;
|
if (himem < pend) himem = pend;
|
||||||
|
@ -1874,6 +1876,8 @@ gc_sweep(rb_objspace_t *objspace)
|
||||||
RVALUE *final = final_list;
|
RVALUE *final = final_list;
|
||||||
int deferred;
|
int deferred;
|
||||||
|
|
||||||
|
if(heaps[i].finalize_flag) continue;
|
||||||
|
|
||||||
p = heaps[i].slot; pend = p + heaps[i].limit;
|
p = heaps[i].slot; pend = p + heaps[i].limit;
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
if (!(p->as.basic.flags & FL_MARK)) {
|
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 */
|
pp->as.free.flags |= FL_SINGLETON; /* freeing page mark */
|
||||||
}
|
}
|
||||||
heaps[i].limit = final_num;
|
heaps[i].limit = final_num;
|
||||||
|
heaps[i].finalize_flag = TRUE;
|
||||||
freelist = free; /* cancel this page from freelist */
|
freelist = free; /* cancel this page from freelist */
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue