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

* gc.c : remove gc_clear_mark_on_sweep_slots() and use

rest_sweep() instead of it, because some dead objects might be
  marked in next the mark phase by false pointers.
  [ruby-core:42672]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nari 2012-02-21 09:35:07 +00:00
parent 2e733be0b2
commit 0d44bf83da
3 changed files with 8369 additions and 13238 deletions

View file

@ -1,3 +1,10 @@
Tue Feb 21 18:21:25 2012 Narihiro Nakamura <authornari@gmail.com>
* gc.c : remove gc_clear_mark_on_sweep_slots() and use
rest_sweep() instead of it, because some dead objects might be
marked in next the mark phase by false pointers.
[ruby-core:42672]
Tue Feb 21 16:08:17 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* proc.c (rb_hash_proc): get wrapped pointer properly. [Bug #6048]

File diff suppressed because it is too large Load diff

26
gc.c
View file

@ -495,14 +495,13 @@ rb_gc_set_params(void)
#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE
static void gc_sweep(rb_objspace_t *);
static void slot_sweep(rb_objspace_t *, struct heaps_slot *);
static void gc_clear_mark_on_sweep_slots(rb_objspace_t *);
static void rest_sweep(rb_objspace_t *);
static void aligned_free(void *);
void
rb_objspace_free(rb_objspace_t *objspace)
{
gc_clear_mark_on_sweep_slots(objspace);
gc_sweep(objspace);
rest_sweep(objspace);
if (objspace->profile.record) {
free(objspace->profile.record);
objspace->profile.record = 0;
@ -2619,21 +2618,6 @@ mark_current_machine_context(rb_objspace_t *objspace, rb_thread_t *th)
#endif
}
static void
gc_clear_mark_on_sweep_slots(rb_objspace_t *objspace)
{
struct heaps_slot *scan;
if (objspace->heap.sweep_slots) {
while (heaps_increment(objspace));
while (objspace->heap.sweep_slots) {
scan = objspace->heap.sweep_slots;
gc_clear_slot_bits(scan);
objspace->heap.sweep_slots = objspace->heap.sweep_slots->next;
}
}
}
static void
gc_marks(rb_objspace_t *objspace)
{
@ -2645,8 +2629,6 @@ gc_marks(rb_objspace_t *objspace)
objspace->count++;
gc_clear_mark_on_sweep_slots(objspace);
SET_STACK_END;
init_mark_stack(objspace);
@ -2703,6 +2685,8 @@ garbage_collect(rb_objspace_t *objspace)
GC_PROF_TIMER_START;
rest_sweep(objspace);
during_gc++;
gc_marks(objspace);
@ -3212,7 +3196,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
size_t i;
/* run finalizers */
gc_clear_mark_on_sweep_slots(objspace);
rest_sweep(objspace);
if (ATOMIC_EXCHANGE(finalizing, 1)) return;