Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
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
riscv-gcc-1
Commits
dbe20842
Commit
dbe20842
authored
Mar 07, 2014
by
Ian Lance Taylor
Committed by
Ian Lance Taylor
Mar 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* sort.c (backtrace_qsort): Use middle element as pivot.
From-SVN: r208403
parent
bc65bdd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
libbacktrace/ChangeLog
+4
-0
libbacktrace/sort.c
+6
-0
No files found.
libbacktrace/ChangeLog
View file @
dbe20842
2014-03-07 Ian Lance Taylor <iant@google.com>
* sort.c (backtrace_qsort): Use middle element as pivot.
2014-03-06 Ian Lance Taylor <iant@google.com>
* sort.c: New file.
...
...
libbacktrace/sort.c
View file @
dbe20842
...
...
@@ -69,6 +69,12 @@ backtrace_qsort (void *basearg, size_t count, size_t size,
if
(
count
<
2
)
return
;
/* The symbol table and DWARF tables, which is all we use this
routine for, tend to be roughly sorted. Pick the middle element
in the array as our pivot point, so that we are more likely to
cut the array in half for each recursion step. */
swap
(
base
,
base
+
(
count
/
2
)
*
size
,
size
);
mid
=
0
;
for
(
i
=
1
;
i
<
count
;
i
++
)
{
...
...
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