-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Harti Brandt wrote:
| On Tue, 1 Jun 2004, osmium wrote:
|
| o>Richard Bos writes:
| o>
| o>> (e-mail address removed) (Richard Tobin) wrote:
| o>>
| o>> > In article <
[email protected]>,
| o>> >
| o>> > >Won't work. He can't do what he wants in portable standard C.
| o>> > >The reason being that many systems will happily return a valid
| o>> > >pointer when usage exceeds main memory, and then thrash data in an
| o>> > >out of disk storage when accessed.
| o>> >
| o>> > It's worse than that. Many operating systems overcommit memory,
| o>> > returning a valid pointer from malloc() and then killing the program
| o>> > when it tries to access too much of it.
| o>>
| o>> Quite apart from this rendering any C implementation on that platform
| o>> unconforming (after all, if malloc() succeeds, the Standard says
you own
| o>> that memory), is there _any_ good reason for this practice? I'd have
| o>> thought simply telling your user that he can't have that much
memory is
| o>> preferable to pretending that he can, and then unceremoniously dumping
| o>> him in it when he tries to use it. I mean, under OSes like that,
what's
| o>> the use of all our precautions of checking that malloc() returned
| o>> succesfully?
| o>
| o>Until I see the name of the offending OS, I will take this to be an
urban
| o>legend.
|
| The orginal BSD VM did overcommitting and so do most BSD derivates. Try
| to google for 'overcommit site:freebsd.org' for discussions.
|
| harti
Linux as well by default, so this is no urban legend.
Ross
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -
http://enigmail.mozdev.org
iD8DBQFAvMwK9bR4xmappRARAtQtAJ45k8iItmlHo2H9kq6dbax1lQfv+gCg47ci
JkDft/IwvaSRNj9DL4SyAUA=
=YnWV
-----END PGP SIGNATURE-----