bitmap: Extend allocation functions
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 2 Oct 2014 14:14:59 +0000 (00:14 +1000)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 13 Oct 2014 02:45:44 +0000 (13:15 +1030)
commitb9c9f5d934cda9717e373824e81670ec075fe001
tree4ac0b0b14f485c5c8b4ab54e12d318905555dc28
parent4e7f97a92ef78a956425f8d0d03e57230e131618
bitmap: Extend allocation functions

The bitmap module already has a simple allocation helper, which returns
an uninitialized, dynamically allocated bitmap of a given size.

This extends this with bitmap_alloc[01]() which allocate bitmaps and
initialize them to all zero or all one.

It also adds bitmap_realloc[01]() which reallocate an existing bitmap,
preserving existing bits, and setting any new bits to all zero or all one.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/bitmap/bitmap.h
ccan/bitmap/test/run-alloc.c [new file with mode: 0644]