On Thu, 15 Apr 1999, Andrew Reilly wrote:

> On Wed, Apr 14, 1999 at 02:55:27PM -0500, Anthony Kimball wrote:
> > 
> > : > All I want is that a program gets NULL from malloc if there is no memory
> > : > available. I find that to be a very fundamental thing about malloc.
> > 
> > : Do you have a solution? We don't.
> > 
> > Make an sbrk variant which will pre-allocate backing store.
> > setenv MALLOC_PREALLOCATE
> > 
> > Not so hard.
> 
> You could do this yourself, I think, by:
> 
> 1) create your own backing file of the appropriate size
> 2) mmap it into your address space
> 3) tell your own malloc() routine that that's where it should
>    get memory from.
> 
> Any problems with that? (besides not being the system standard,
> and the reduction of swapping efficiency caused by going through
> the file system).

actually doesn't the BSD mmap spec state that if you map anything
anon without special flags and there is no backing store available
that the call will fail, and that there is a way to pass a flag to tell
the system to overcommit but that you are prepared to take a SIGSEGV 
if you do cause the system to run out of backing store on the mepped object?

looking at the manpages it seems that this is either undocumented or
was never completed.

-Alfred




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

Reply via email to