[ccan] [PATCH] heap: new module

Emilio G. Cota cota at braap.org
Wed Sep 11 02:08:27 EST 2013


On Tue, Sep 10, 2013 at 14:38:11 +0930, Rusty Russell wrote:
> You might also want an example using heap->len, since it's probably
> required for safe usage in general, eg under heap_peek:
> 
> Example:
>         // Safe wrapper: returns NULL if heap empty
>         static inline void *heap_top(const struct heap *h)
>         {
>                 return h->num ? heap_peek(h) : NULL;
>         }

Very good suggestion, will push once the key is in place.

Thanks,

		Emilio


More information about the ccan mailing list