talloc: keep reference to pool even if we overflow it.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 28 Jun 2012 07:39:46 +0000 (17:09 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 28 Jun 2012 07:39:46 +0000 (17:09 +0930)
commitfe56e52ac7cd4395c85bdcf15c219d9d07cfdabe
tree87ed38f0268db71a7c256dea61bc93f6060d4702
parentfd305ee30951f107c612d249ca1384c84808def0
talloc: keep reference to pool even if we overflow it.

If you talloc off a pool, and it doesn't fit, we fallback to a non-pool
talloc.  Unfortunately, all children of that allocation are also unaware
of the pool, even if they would fit.

Instead, save the pool pointer even if we overflow: that way we can
correctly allocate children if they fit.  It also permits better
debugging in the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
lib/talloc/talloc.c
lib/talloc/talloc.h
lib/talloc/testsuite.c