Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b228fee2
Commit
b228fee2
authored
Jul 17, 2009
by
V Narayanan
Browse files
Options
Browse Files
Download
Plain Diff
merging with mysql-5.0-bugteam
parents
2f58197d
ce0bf2a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
mysys/array.c
mysys/array.c
+7
-6
No files found.
mysys/array.c
View file @
b228fee2
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment