Re: Setjmp/Longjmp in the kernel?

From: John W. M. Stevens (
Date: Wed Feb 12 2003 - 14:45:01 EST

On Wed, Feb 12, 2003 at 11:55:32AM +0100, Kasper Dupont wrote:
> Olaf Titz wrote:
> >
> > Not that this matters any bit, but the proper order is of course
> > alloc this
> > alloc that
> > _foo_func()
> > free that
> > free this
> >
> > even if only for aesthetical reasons :-)
> >
> > (with locks, it does matter...)
> For locks it is only when you lock the order matters, not when
> you unlock. For allocations there is of course the possibility
> that the first allocation suceeds and the second fails, which
> you must handle in some way.

The usual way is with "pools".

Every resource allocated after a "mark" point gets dumped into
a separate pool, and then when processing returns to the mark
point, the pools are drained, one way or the other.

For locks, the pools are ordered, and you swim backwards through
the pool.

John S.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:44 EST