lib/genalloc.c: resync with caf