Buffning
2006-08-11 16:10:12 UTC
I'm running into a problem with my code: PointsRemaining never
actually reaches 0. It goes from 1 to 800 and starts counting
down again. Is there a way to force it not to wrap around?
It seems to default to wrapping around in the built-in examples also.
------------------------------------------------
memorylocation = (char*) MapViewOfFile(hmemmap,
FILE_MAP_WRITE, 0, numberofbuffersmapped*buffersize*2, buffersize*2);
iStatus = DIG_Block_In(iDevice, iGroup, (short*) memorylocation, buffersize);
// number of buffers mapped can't change unless the line that says how big of a file to create changes.
while ( ((end-start)/1000 < 10) && (numberofbuffersmapped < 6500))
{
end = clock();
if (PointsRemaining <= 0)
{
numberofbuffersmapped++;
UnmapViewOfFile(memorylocation);
memorylocation
= (char*) MapViewOfFile(hmemmap, FILE_MAP_WRITE, 0,
numberofbuffersmapped*1600, 1600);
iStatus = DIG_Block_In(iDevice, iGroup, (short*) memorylocation, 800);
start = clock();
}
iStatus = DIG_Block_Check( iDevice, iGroup, &PointsRemaining);
}
actually reaches 0. It goes from 1 to 800 and starts counting
down again. Is there a way to force it not to wrap around?
It seems to default to wrapping around in the built-in examples also.
------------------------------------------------
memorylocation = (char*) MapViewOfFile(hmemmap,
FILE_MAP_WRITE, 0, numberofbuffersmapped*buffersize*2, buffersize*2);
iStatus = DIG_Block_In(iDevice, iGroup, (short*) memorylocation, buffersize);
// number of buffers mapped can't change unless the line that says how big of a file to create changes.
while ( ((end-start)/1000 < 10) && (numberofbuffersmapped < 6500))
{
end = clock();
if (PointsRemaining <= 0)
{
numberofbuffersmapped++;
UnmapViewOfFile(memorylocation);
memorylocation
= (char*) MapViewOfFile(hmemmap, FILE_MAP_WRITE, 0,
numberofbuffersmapped*1600, 1600);
iStatus = DIG_Block_In(iDevice, iGroup, (short*) memorylocation, 800);
start = clock();
}
iStatus = DIG_Block_Check( iDevice, iGroup, &PointsRemaining);
}