 |
|
hello, i am pm
Join Date: Jan 2004
Location: Canalization
|

05-05-2006
, 14:09
|
#4
|
You see, that's a lot of memory. 150*128*4 = 76800 = 75 kB on the stack... Should be avoided when possible (although the compiler _should_ have computed the estimated stack size correctly in this case I think.. hmm.)
Instead, you could only hold a buffer for one line and process them on the fly ( in the body of the loop which has read_file in its condition ). This way you also wouldn't need to re-evaluate the length of each line (read_file fills it in the last parameter). I was also a bit surprised that you reserved a 128 byte buffer for each line and then told read_file to return 31 characters at max. You may want to use a constant for the line buffer length so you don't have to change it in two places (but then do constant+1 in the buffer declaration).
You may also want to try using the new file natives.
Also, the // Semicolon before module name found comment was misleading I'm afraid.
Well, my thoughts.
__________________
hello, i am pm
|
|
|
|