File IO

From: ajs (ajs00g_at_gmail.com)
Date: 02/22/05


Date: 22 Feb 2005 10:29:16 -0800

Hi
I am using INTEL 8.0 on a linux machine. I had a problem, managed to
fix it, but am trying to understand why this happens and if I should be
filing a bug report or something.

THe problem is with using implicit do loops to read : I am reading a
very large file (380MB or so) and if I read it using : (assuimg
im,jm,km,nm have been set)

read(10) fun(1:im,1:jm,1:km,1:nm)

it blows stack. So I set my stacksize limit to unlimited and re-rerun.
This works for one file. When I do the same read on a series of files
over and over again (in a loop, not multiple invocations of the
program), it eventually does the same thing! Then I changed the read
statement to :

read(10) ((((fun(i,j,k,n),i=1,im),j=1,jm),k=1,km),n=1,nm)

This magically works fine for virtually any number of reads. Is this
bug in the compiler or is this supposed to happen? Or is my stack
blowing theory itself all wrong? If that is the case, why did it work
on one file when I increased the stacksize limit?

Any help is appreciated, Thanks a lot.
Srinivasan



Relevant Pages

  • Re: Toward a Forth thats easier to learn
    ... newbies make when they step out of the sandbox. ... You can't access return stack items inside a do loop because the loop ... Loops that count down give a different number of iterations for the ... It's a trap for beginning Forth programmers that probably ...
    (comp.lang.forth)
  • Re: why do loop control variables have to be local ?
    ... an identifier always refers to the ... >> same location on the stack. ... You had three nested loops. ... When did you wind up with zero stack space? ...
    (alt.comp.lang.borland-delphi)
  • Re: made it to page 4 of gforth tutorial
    ... In the above example, frob calls times, passing it blob as an xt. ... but I find it nicer than writing explicit loops. ... Your TIMES isn't any good because it leaves the xt on the stack. ... See EACH in list.4th in my novice package for an example of the ...
    (comp.lang.forth)
  • Re: System::String question
    ... I know it looks odd, but you code would work in the following manner ... I will follow up up on why decided to disallow String with stack semantics ... If I create my own ref class and instantiate it with the ... > I just edited the bug report: ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Javascript recursion limit
    ... Hence the requirement of a stack for recursion, ... loops, infinite loops etc. these are all top level mental constructs ... Respectively the engine itself doesn't care what RETs are these: ... At the same time these limits may hit noticeably recursion based code, ...
    (comp.lang.javascript)