sbrk(2) broken

Andrew Reilly andrew-freebsd at areilly.bpc-users.org
Mon Jan 7 15:20:25 PST 2008


On Mon, 07 Jan 2008 13:18:47 +0000
"Poul-Henning Kamp" <phk at phk.freebsd.dk> wrote:

> Yes, but you will not see this complication, it will be hidden
> in the implementation of malloc(3).

How could you hide it inside malloc?  Would malloc start
returning 0 after receiving the "less mem than desirable"
signal?  Would it ever go back to returning non-zero?

I thought that the idea of things like SIGDANGER was that
applications would be written to have a mode where they could
shut down some aspect of their operation, and free resources.  I
don't see how you can do that, autonomously, from within malloc?

Maybe introduce a special flavour of pointer value, returned by a
special version of malloc for "cache" objects, that the system is
allowed to automatically reclaim?  Then programs would need to be
able to handle SIGSEGV when accessing those...

Cheers,

-- 
Andrew


More information about the freebsd-current mailing list