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).

-- 
Andrew


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

Reply via email to