Szabolcs Borsanyi <> writes:
>> smarty wrote:
>>
>> Just malloc what you need and check the returned value. If it is
>> NULL that memory is not available.
>>
> I would not do that. The standard has no guarantee for a correct
> program to run,
> just that if it runs, then the output is correct.
> <off>
> Modern systems (like linux) tend to be overoptimistic in the malloc
> call and they
> check only the availability of the addressing space, but not the
> physical
> memory or swap space. On the first write the kernel will think about
> how to
> acquire the memory, and kill someone if it does not succeed otherwise.
>
> As for me, I usually ask the system of the total memory (there are
> system calls
> on most platforms that return this information) and my programs assume
> that
> all (or 80%) is available. And systems with lazy allocation take that
> quite well.
> </off>
Can you please format your text to a maximum of, say, 72 columns?
It appears that you're writing lines up to about 81 columns,
and something somewhere is shortening them to about 70 columns.
The result is the alternating long and short lines seen above,
which are difficult to read.
If you're on a Unix-like system, you can filter your paragraphs
through something like "fmt -72" or "fmt -70", or perhaps your
text editor or newsreader has a "fill" command.
Thanks.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"