On Thu, Nov 28, 2013 at 10:39 AM, Luigi Rizzo <[email protected]> wrote: > function reserve_sfa_size() uses ksize() (twice!) > to figure out whether it is possible to use some > extra space in the struct sf_flow_actions, or the > buffer should be reallocated. > > Wouldn't it make more sense to rewrite the function > so that it uses krealloc() instead ?
I think the main difference is that the existing function checks if the current need is met and if not it doubles the buffer size instead of just requesting the new size. Depending on the allocator, this may happen even with krealloc() but it's not guaranteed. Obviously, it would be possible to factor out the second ksize() call in the current implementation regardless. _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
