* gc.c (is_before_sweep): Add new helper function that check the object
is before sweep? * gc.c (rb_gc_force_recycle): Have to clear mark bit if object's slot already ready to mainor sweep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3f44f7f24c
commit
b0993c733f
@ -1,3 +1,10 @@
|
|||||||
|
Wed Jun 26 01:18:13 2013 Masaya Tarui <tarui@ruby-lang.org>
|
||||||
|
|
||||||
|
* gc.c (is_before_sweep): Add new helper function that check the object
|
||||||
|
is before sweep?
|
||||||
|
* gc.c (rb_gc_force_recycle): Have to clear mark bit if object's slot
|
||||||
|
already ready to mainor sweep.
|
||||||
|
|
||||||
Wed Jun 26 01:17:29 2013 Tanaka Akira <akr@fsij.org>
|
Wed Jun 26 01:17:29 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* bignum.c (bigsub_int): Fix a buffer over read.
|
* bignum.c (bigsub_int): Fix a buffer over read.
|
||||||
|
19
gc.c
19
gc.c
@ -603,6 +603,22 @@ RVALUE_PROMOTE(VALUE obj)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int
|
||||||
|
is_before_sweep(VALUE obj)
|
||||||
|
{
|
||||||
|
struct heaps_slot *slot;
|
||||||
|
rb_objspace_t *objspace = &rb_objspace;
|
||||||
|
if (is_lazy_sweeping(objspace)) {
|
||||||
|
slot = objspace->heap.sweep_slots;
|
||||||
|
while (slot) {
|
||||||
|
if(slot->header == GET_HEAP_HEADER(obj))
|
||||||
|
return TRUE;
|
||||||
|
slot = slot->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
RVALUE_DEMOTE(VALUE obj)
|
RVALUE_DEMOTE(VALUE obj)
|
||||||
{
|
{
|
||||||
@ -3971,6 +3987,9 @@ rb_gc_force_recycle(VALUE p)
|
|||||||
#if USE_RGENGC
|
#if USE_RGENGC
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(p), p);
|
CLEAR_IN_BITMAP(GET_HEAP_REMEMBERSET_BITS(p), p);
|
||||||
CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(p), p);
|
CLEAR_IN_BITMAP(GET_HEAP_OLDGEN_BITS(p), p);
|
||||||
|
if(!is_before_sweep(p)){
|
||||||
|
CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS(p), p);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
objspace->total_freed_object_num++;
|
objspace->total_freed_object_num++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user