Re: sbrk(2) broken

From: Andrew Reilly <andrew-freebsd_at_areilly.bpc-users.org>
Date: Tue, 8 Jan 2008 10:19:42 +1100
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
Received on Mon Jan 07 2008 - 22:20:25 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:25 UTC