Looks ok to me, although for a fixed size argument the whole overflow
detection thing in struct_size() is rather pointless..
On 5/17/19 2:03 AM, xiaolinkui wrote:
> Use struct_size() to keep code sample.
What do you mean by that?
> One of the more common cases of allocation size calculations is finding
> the size of a structure that has a zero-sized array at the end, along
> with memory for some number of elements
If maintainers are okay with this then,
Reviewed-by: Chaitanya Kulkarni
On 5/17/19 12:07 AM, xiaolinkui wrote:
> Use struct_size() to keep code sample.
> One of the more common cases of allocation size calculations is finding
> the size of a structure that has a zero-sized array at the end,
Use struct_size() to keep code sample.
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:
struct foo {
int stuff;
struct boo
4 matches
Mail list logo