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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
242a28c3
Commit
242a28c3
authored
May 28, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6812: Remove the wrapper my_log2f()
parent
661289f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
28 deletions
+6
-28
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+3
-14
storage/xtradb/row/row0merge.cc
storage/xtradb/row/row0merge.cc
+3
-14
No files found.
storage/innobase/row/row0merge.cc
View file @
242a28c3
...
...
@@ -27,6 +27,7 @@ Completed by Sunny Bains and Marko Makela
#include <my_config.h>
#include <log.h>
#include <sql_class.h>
#include <math.h>
#include "row0merge.h"
#include "row0ext.h"
...
...
@@ -42,15 +43,8 @@ Completed by Sunny Bains and Marko Makela
#include "row0import.h"
#include "handler0alter.h"
#include "ha_prototypes.h"
#include "math.h"
/* log() */
#include "fil0crypt.h"
float
my_log2f
(
float
n
)
{
/* log(n) / log(2) is log2. */
return
(
float
)(
log
((
double
)
n
)
/
log
((
double
)
2
));
}
/* Ignore posix_fadvise() on those platforms where it does not exist */
#if defined __WIN__
# define posix_fadvise(fd, offset, len, advice)
/* nothing */
...
...
@@ -2503,18 +2497,13 @@ row_merge_sort(
/* Record the number of merge runs we need to perform */
num_runs
=
file
->
offset
;
/* Find the number N which 2^N is greater or equal than num_runs */
/* N is merge sort running count */
total_merge_sort_count
=
ceil
(
my_log2f
(
num_runs
));
if
(
total_merge_sort_count
<=
0
)
{
total_merge_sort_count
=
1
;
}
/* If num_runs are less than 1, nothing to merge */
if
(
num_runs
<=
1
)
{
DBUG_RETURN
(
error
);
}
total_merge_sort_count
=
ceil
(
log2f
(
num_runs
));
/* "run_offset" records each run's first offset number */
run_offset
=
(
ulint
*
)
mem_alloc
(
file
->
offset
*
sizeof
(
ulint
));
...
...
storage/xtradb/row/row0merge.cc
View file @
242a28c3
...
...
@@ -27,6 +27,7 @@ Completed by Sunny Bains and Marko Makela
#include <my_config.h>
#include <log.h>
#include <sql_class.h>
#include <math.h>
#include "row0merge.h"
#include "row0ext.h"
...
...
@@ -42,15 +43,8 @@ Completed by Sunny Bains and Marko Makela
#include "row0import.h"
#include "handler0alter.h"
#include "ha_prototypes.h"
#include "math.h"
/* log2() */
#include "fil0crypt.h"
float
my_log2f
(
float
n
)
{
/* log(n) / log(2) is log2. */
return
(
float
)(
log
((
double
)
n
)
/
log
((
double
)
2
));
}
/* Ignore posix_fadvise() on those platforms where it does not exist */
#if defined __WIN__
# define posix_fadvise(fd, offset, len, advice)
/* nothing */
...
...
@@ -2516,18 +2510,13 @@ row_merge_sort(
/* Record the number of merge runs we need to perform */
num_runs
=
file
->
offset
;
/* Find the number N which 2^N is greater or equal than num_runs */
/* N is merge sort running count */
total_merge_sort_count
=
ceil
(
my_log2f
(
num_runs
));
if
(
total_merge_sort_count
<=
0
)
{
total_merge_sort_count
=
1
;
}
/* If num_runs are less than 1, nothing to merge */
if
(
num_runs
<=
1
)
{
DBUG_RETURN
(
error
);
}
total_merge_sort_count
=
ceil
(
log2f
(
num_runs
));
/* "run_offset" records each run's first offset number */
run_offset
=
(
ulint
*
)
mem_alloc
(
file
->
offset
*
sizeof
(
ulint
));
...
...
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