Revision c0f12bb6f3ea8f1350371695b42990a5c2eb93f2 authored by Giuseppe Attardi on 02 March 1998, 23:00:00 UTC, committed by CMM Curation Team on 11 December 2019, 14:35:48 UTC
Contributors mentioned in Changelog : - Giuseppe Attardi @attardi - Tito Flagella @tflagella - Pietro Iglio
1 parent 55778ad
test8.cpp
// Contributed by Christian Heckler <chh@plato.uni-paderborn.de>
// This tests the MARKING algorithm when objects have pointers to later
// objects in the page.
#include "cmm.h"
#include <stdio.h>
const int length=100000;
class TestClass: public CmmObject
{
public:
int data;
TestClass *next;
void traverse();
};
void TestClass::traverse()
{
Cmm::heap->scavenge((CmmObject **)&next);
}
typedef TestClass* Classptr;
void createlist(Classptr p)
{
int i;
for (i = 0; i < length; i++)
{
p = p->next = new TestClass;
if (i % 10000 == 0)
{ printf("|"); fflush(stdout); }
else if (i % 1000 == 0)
printf(".");
}
p->next = NULL;
}
void
main()
{
Classptr p0;
p0 = new TestClass;
createlist(p0);
printf("\n");
}
Computing file changes ...