Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
59e3f45b
Commit
59e3f45b
authored
Jul 25, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2487 from libgit2/cmn/revwalk-no-prealloc
Work around strict aliasing in array growth
parents
9de6ec52
b62a6a13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
4 deletions
+1
-4
src/array.h
+1
-1
src/revwalk.c
+0
-3
No files found.
src/array.h
View file @
59e3f45b
...
@@ -44,7 +44,7 @@ typedef git_array_t(char) git_array_generic_t;
...
@@ -44,7 +44,7 @@ typedef git_array_t(char) git_array_generic_t;
/* use a generic array for growth so this can return the new item */
/* use a generic array for growth so this can return the new item */
GIT_INLINE
(
void
*
)
git_array_grow
(
void
*
_a
,
size_t
item_size
)
GIT_INLINE
(
void
*
)
git_array_grow
(
void
*
_a
,
size_t
item_size
)
{
{
git_array_generic_t
*
a
=
_a
;
volatile
git_array_generic_t
*
a
=
_a
;
uint32_t
new_size
=
(
a
->
size
<
8
)
?
8
:
a
->
asize
*
3
/
2
;
uint32_t
new_size
=
(
a
->
size
<
8
)
?
8
:
a
->
asize
*
3
/
2
;
char
*
new_array
=
git__realloc
(
a
->
ptr
,
new_size
*
item_size
);
char
*
new_array
=
git__realloc
(
a
->
ptr
,
new_size
*
item_size
);
if
(
!
new_array
)
{
if
(
!
new_array
)
{
...
...
src/revwalk.c
View file @
59e3f45b
...
@@ -48,9 +48,6 @@ static int mark_uninteresting(git_revwalk *walk, git_commit_list_node *commit)
...
@@ -48,9 +48,6 @@ static int mark_uninteresting(git_revwalk *walk, git_commit_list_node *commit)
assert
(
commit
);
assert
(
commit
);
git_array_init_to_size
(
pending
,
2
);
GITERR_CHECK_ARRAY
(
pending
);
do
{
do
{
commit
->
uninteresting
=
1
;
commit
->
uninteresting
=
1
;
...
...
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