Poul-Henning Kamp once stated:

=malloc() on FreeBSD returns NULL when it cannot allocate the memory
=asked for.

=If you have an example where this is not the case I would VERY
=much like to see it.

I believe, a number of examples were given, when the use of the non-NULL
pointer returned by malloc resulted in the program being killed.

Those who asked why, were given an answer:

        . because you allocated more memory then you have

They then, rightfully exclaimed:

        . but should not malloc() have returned me NULL?

And the rest is drowned in the explanations of why it is very hard to assure.
I'm repeating myself here and so do others. We are probably facing the major
disadvantange of the "overcommit" strategy, and there may not, indeed, be a
way around this.

Documenting this properly is what is definitely in order...

While we are at this, what is the right way to find out if the returned pointer
can be used?

        -mi


To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to