mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
* gc.c: catch up last changes for debugging/checking mode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9860c846d0
commit
caa14925cc
2 changed files with 12 additions and 8 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Wed Jul 17 15:59:33 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* gc.c: catch up last changes for debugging/checking mode.
|
||||||
|
|
||||||
Wed Jul 17 15:50:10 2013 Koichi Sasada <ko1@atdot.net>
|
Wed Jul 17 15:50:10 2013 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.c (rb_objspace_free): free slot itself.
|
* gc.c (rb_objspace_free): free slot itself.
|
||||||
|
|
16
gc.c
16
gc.c
|
@ -829,7 +829,7 @@ assign_heap_slot(rb_objspace_t *objspace)
|
||||||
heap_used++;
|
heap_used++;
|
||||||
|
|
||||||
for (p = start; p != end; p++) {
|
for (p = start; p != end; p++) {
|
||||||
rgengc_report(3, objspace, "assign_heap_slot: %p (%s) is added to freelist\n", p, obj_type_name((VALUE)p));
|
rgengc_report(3, objspace, "assign_heap_slot: %p is added to freelist\n");
|
||||||
slot_add_freeobj(objspace, slot, (VALUE)p);
|
slot_add_freeobj(objspace, slot, (VALUE)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3557,8 +3557,8 @@ static void
|
||||||
gc_oldgen_bitmap2flag(struct heap_slot *slot)
|
gc_oldgen_bitmap2flag(struct heap_slot *slot)
|
||||||
{
|
{
|
||||||
bits_t *oldgen_bits = &slot->oldgen_bits[0];
|
bits_t *oldgen_bits = &slot->oldgen_bits[0];
|
||||||
RVALUE *p = slot->header->start;
|
RVALUE *p = slot->start;
|
||||||
RVALUE *pend = p + slot->header->limit;
|
RVALUE *pend = p + slot->limit;
|
||||||
|
|
||||||
while (p < pend) {
|
while (p < pend) {
|
||||||
if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_OLDGEN);
|
if (MARKED_IN_BITMAP(oldgen_bits, p)) FL_SET2(p, FL_OLDGEN);
|
||||||
|
@ -3576,7 +3576,7 @@ gc_export_bitmaps(rb_objspace_t *objspace)
|
||||||
if (exported_bitmaps == 0) rb_bug("gc_store_bitmaps: not enough memory to test.\n");
|
if (exported_bitmaps == 0) rb_bug("gc_store_bitmaps: not enough memory to test.\n");
|
||||||
|
|
||||||
for (i=0; i<heap_used; i++) {
|
for (i=0; i<heap_used; i++) {
|
||||||
struct heap_slot *slot = objspace->heap.sorted[i]->base;
|
struct heap_slot *slot = objspace->heap.sorted[i];
|
||||||
|
|
||||||
memcpy(&exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT], &slot->mark_bits[0], HEAP_BITMAP_SIZE);
|
memcpy(&exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT], &slot->mark_bits[0], HEAP_BITMAP_SIZE);
|
||||||
memcpy(&exported_bitmaps[(3*i+1)*HEAP_BITMAP_LIMIT], &slot->rememberset_bits[0], HEAP_BITMAP_SIZE);
|
memcpy(&exported_bitmaps[(3*i+1)*HEAP_BITMAP_LIMIT], &slot->rememberset_bits[0], HEAP_BITMAP_SIZE);
|
||||||
|
@ -3592,7 +3592,7 @@ gc_restore_exported_bitmaps(rb_objspace_t *objspace, bits_t *exported_bitmaps)
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i=0; i<heap_used; i++) {
|
for (i=0; i<heap_used; i++) {
|
||||||
struct heap_slot *slot = objspace->heap.sorted[i]->base;
|
struct heap_slot *slot = objspace->heap.sorted[i];
|
||||||
|
|
||||||
/* restore bitmaps */
|
/* restore bitmaps */
|
||||||
memcpy(&slot->mark_bits[0], &exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT], HEAP_BITMAP_SIZE);
|
memcpy(&slot->mark_bits[0], &exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT], HEAP_BITMAP_SIZE);
|
||||||
|
@ -3616,7 +3616,7 @@ gc_save_bitmaps(rb_objspace_t *objspace)
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i=0; i<heap_used; i++) {
|
for (i=0; i<heap_used; i++) {
|
||||||
struct heap_slot *slot = objspace->heap.sorted[i]->base;
|
struct heap_slot *slot = objspace->heap.sorted[i];
|
||||||
|
|
||||||
/* save bitmaps */
|
/* save bitmaps */
|
||||||
memcpy(&slot->saved_mark_bits[0], &slot->mark_bits[0], HEAP_BITMAP_SIZE);
|
memcpy(&slot->saved_mark_bits[0], &slot->mark_bits[0], HEAP_BITMAP_SIZE);
|
||||||
|
@ -3633,7 +3633,7 @@ gc_load_bitmaps(rb_objspace_t *objspace)
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i=0; i<heap_used; i++) {
|
for (i=0; i<heap_used; i++) {
|
||||||
struct heap_slot *slot = objspace->heap.sorted[i]->base;
|
struct heap_slot *slot = objspace->heap.sorted[i];
|
||||||
|
|
||||||
/* load bitmaps */
|
/* load bitmaps */
|
||||||
memcpy(&slot->mark_bits[0], &slot->saved_mark_bits[0], HEAP_BITMAP_SIZE);
|
memcpy(&slot->mark_bits[0], &slot->saved_mark_bits[0], HEAP_BITMAP_SIZE);
|
||||||
|
@ -3682,7 +3682,7 @@ gc_marks_test(rb_objspace_t *objspace)
|
||||||
/* check */
|
/* check */
|
||||||
for (i=0; i<heap_used; i++) {
|
for (i=0; i<heap_used; i++) {
|
||||||
bits_t *minor_mark_bits = &exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT];
|
bits_t *minor_mark_bits = &exported_bitmaps[(3*i+0)*HEAP_BITMAP_LIMIT];
|
||||||
bits_t *major_mark_bits = objspace->heap.sorted[i]->base->mark_bits;
|
bits_t *major_mark_bits = objspace->heap.sorted[i]->mark_bits;
|
||||||
RVALUE *p = objspace->heap.sorted[i]->start;
|
RVALUE *p = objspace->heap.sorted[i]->start;
|
||||||
RVALUE *pend = p + objspace->heap.sorted[i]->limit;
|
RVALUE *pend = p + objspace->heap.sorted[i]->limit;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue