• David Rientjes's avatar
    Add a new function to the flex_array API: · cf31429c
    David Rientjes authored
    	int flex_array_clear(struct flex_array *fa,
    				unsigned int element_nr)
    
    This function will zero the element at element_nr in the flex_array.
    
    Although this is equivalent to using flex_array_put() and passing a
    pointer to zero'd memory, flex_array_clear() does not require such a
    pointer to memory that would most likely need to be allocated on the
    caller's stack which could be significantly large depending on
    element_size.
    Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
    Cc: Dave Hansen <dave@linux.vnet.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    cf31429c
flex_array.h 1.27 KB