Home > other >  The doubts in openVswitch elements_fit_in_base () function
The doubts in openVswitch elements_fit_in_base () function

Time:10-02

The realization of the function code:
Int data_size=fa - & gt; Element_size * fa - & gt; Total_nr_elements;
If (data_size & lt;=FLEX_ARRAY_BASE_BYTES_LEFT)
return 1;
return 0;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The function of this function is what mean? My personal analysis is: to check the parts [0] array element is the data being filled (because a lot of function calls this function after the next line of code is used directly with parts [0], so it is with parts [0] is the data fill up), the first line of code, is to get all the data size; But the second line is flex_array elasticity in the number of array elements, this should be morally and page (1024) to compare, but why is and parts [] array size comparison, (parts [] array size=(1024) - flex_array removed parts other members of the [] array size data size)? This makes me confused, know explain,
  • Related