pugboy3
BSOD
- Messages
- 4
I am writting a rather complicated little node based tree and trying to iterate over the full and untouched set of n before the dijkstra implementation - seen here in pseudo code form : http://en.wikipedia.org/wiki/Dijkstra's_algorithm#Algorithm can complete full running.
Anyway - the current code I have is as follows:
for (loop=0; loop<NLOOP; loop++)
{
for (pass=0; pass<NPASS; pass++)
{
for (subpass=0; subpass<SUBP; subpass++)
{
for (i=0; i<MAXP; i++)
{
int rno = rand();
if (rno & 8)
{
if (pointers)
{
if (!(rno & realloc_mask))
{
r = rsize();
curmax -= size;
curmax += r;
pointers = realloc(pointers, rsize());
size = r;
if (absmax < curmax) absmax = curmax;
}
else
{
curmax -= size;
free(pointers);
pointers = 0;
}
}
else
{
r = rsize();
curmax += r;
pointers = malloc(r);
size = r;
if (absmax < curmax) absmax = curmax;
}
}
}
}
}
There is something odd about the curmax variable on the 76th and 95 iteration where it infact equals !=0.
Any ideas - im desperate.
Rolf
Anyway - the current code I have is as follows:
for (loop=0; loop<NLOOP; loop++)
{
for (pass=0; pass<NPASS; pass++)
{
for (subpass=0; subpass<SUBP; subpass++)
{
for (i=0; i<MAXP; i++)
{
int rno = rand();
if (rno & 8)
{
if (pointers)
{
if (!(rno & realloc_mask))
{
r = rsize();
curmax -= size;
curmax += r;
pointers = realloc(pointers, rsize());
size = r;
if (absmax < curmax) absmax = curmax;
}
else
{
curmax -= size;
free(pointers);
pointers = 0;
}
}
else
{
r = rsize();
curmax += r;
pointers = malloc(r);
size = r;
if (absmax < curmax) absmax = curmax;
}
}
}
}
}
There is something odd about the curmax variable on the 76th and 95 iteration where it infact equals !=0.
Any ideas - im desperate.
Rolf