コード例 #1
0
  void test_collect_mature_marks_young_objects() {
    ObjectMemory& om = *state->memory();
    Tuple* young;
    Object* mature;

    om.large_object_threshold = sizeof(void *) * 50 * 8 / 32;

    young =  util_new_object(om);
    mature = util_new_object(om,20);

    young->field[0] = mature; // dangerous, but ok in tests

    unsigned int mark = om.mark();
    TS_ASSERT(!young->marked_p(mark));
    Root r(roots, young);

    om.collect_mature(state, gc_data);
    gc_data = NULL;

    TS_ASSERT(young->marked_p(mark));
  }
コード例 #2
0
  void test_collect_mature_marks_young_objects() {
    ObjectMemory& om = *state->vm()->om;
    Tuple* young;
    Object* mature;

    om.large_object_threshold = 50 * 8 * sizeof(void *) / 32;

    young =  util_new_object(om);
    mature = util_new_object(om,20);

    young->field[0] = mature; // dangerous, but ok in tests

    Root r(roots, young);

    om.collect_mature(*gc_data);
    TS_ASSERT_EQUALS(young->marked_p(om.mark()), 0U);
  }