Paul Brook wrote:
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.

Sure.

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.

That's if you have the base object do the allocation, yup.

Paul



Reply via email to