[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH V2 3/6] [RFC] xen/common: Introduce _xrealloc function



On 06.08.2019 20:50, Oleksandr wrote:
On 05.08.19 13:02, Jan Beulich wrote:
I can't
see though how a type-safe "realloc" could look like, except for
arrays. If resizing arrays is all you're after, I'd like to
recommend to go that route rather then the suggested one here. If
resizing arbitrary objects is the goal, then what you suggest may
be the only route, but I'd still be not overly happy to see such
added.

My main goal is to get "ported" from Linux "iommu_fwspec" support (xrealloc 
user) in [1].

I tried to retain code as much as possible while porting. So, this patch adds 
almost the same thing what the ported code expects.

But, I would be OK to consider modifying a code in a way to resize an array as 
well as any other variants if present.

I've looked at the use in patch 4, and it really isn't an array
allocation. Even a basic allocation would use _xmalloc() in this
case (you'll find examples in the tree if you want). Nevertheless
I'd appreciate if the type-unsafe _xrealloc() didn't remain the
only re-allocation construct, as to avoiding people using it just
because there's no better alternative.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.