Re: Variable-sized lines of text in linked list



CBFalconer <cbfalconer@xxxxxxxxx> writes:

Disagree. For some operations, it is virtually necessary. For
example the freverse exercise used as a test for ggets, which
reverses the content of an entire text file, byte by byte.

If reversing a file bigger than memory is a likely application,
then I would use a different approach, for example reading and
reversing as large a block of data as will fit in memory at once
and writing it to a file, repeating this with additional files
while data is still arriving, then outputting the files in
reverse order of their creation when the end of the input is
reached.

At the same time bear in mind that many, if not most, general
systems today supply virtual memory. That means that malloc won't
run out of space until the disk does, to all practical purposes.

My PC here has 160 GB of free disk space, but only 3 GB of
virtual address space is available to any given application at a
time, so that is not remotely true.
--
char a[]="\n .CJacehknorstu";int putchar(int);int main(void){unsigned long b[]
={0x67dffdff,0x9aa9aa6a,0xa77ffda9,0x7da6aa6a,0xa67f6aaa,0xaa9aa9f6,0x11f6},*p
=b,i=24;for(;p+=!*p;*p/=4)switch(0[p]&3)case 0:{return 0;for(p--;i--;i--)case+
2:{i++;if(i)break;else default:continue;if(0)case 1:putchar(a[i&15]);break;}}}
.