> type *qemu_new(type, n_types); > type *qemu_new0(type, n_types); > > type *qemu_renew(type, mem, n_types); > type *qemu_renew0(type, mem, n_types);
It always annoys me having to specify element count for things that aren't arrays. I suggestion a single object allocation function, and an array allocation function that allows zero length arrays. Possibly also a must-not-be-zero array form if we think it's important. Note that conversion to object/type based allocation is not always straightforward because inheritance means we don't have the final object type when doing the allocation. Paul