Commit 74d4c331 authored by V Narayanan's avatar V Narayanan

merging with mysql-5.0-bugteam

parents 1e32574c 55588472
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
DESCRIPTION DESCRIPTION
init_dynamic_array() initiates array and allocate space for init_dynamic_array() initiates array and allocate space for
init_alloc eilements. init_alloc eilements.
Array is usable even if space allocation failed. Array is usable even if space allocation failed, hence, the
function never returns TRUE.
RETURN VALUE RETURN VALUE
TRUE my_malloc_ci() failed
FALSE Ok FALSE Ok
*/ */
...@@ -56,11 +56,12 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, ...@@ -56,11 +56,12 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
array->max_element=init_alloc; array->max_element=init_alloc;
array->alloc_increment=alloc_increment; array->alloc_increment=alloc_increment;
array->size_of_element=element_size; array->size_of_element=element_size;
if (!(array->buffer=(char*) my_malloc_ci(element_size*init_alloc,MYF(MY_WME)))) /*
{ Since the dynamic array is usable even if allocation fails here malloc
should not throw an error
*/
if (!(array->buffer= (char*) my_malloc_ci(element_size*init_alloc, MYF(0))))
array->max_element=0; array->max_element=0;
DBUG_RETURN(TRUE);
}
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment