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
b9b8c6ae
Commit
b9b8c6ae
authored
Nov 07, 2011
by
Xinliang David Li
Committed by
Xinliang David Li
Nov 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make __stl_prime_list in comdat
From-SVN: r181071
parent
e97764b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
libstdc++-v3/ChangeLog
+5
-0
libstdc++-v3/include/backward/hashtable.h
+22
-4
No files found.
libstdc++-v3/ChangeLog
View file @
b9b8c6ae
2011-11-07 Xinliang David Li <davidxl@google.com>
* include/backward/hashtable.h: Make __stl_prime_list
in comdat section.
2011-11-07 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/basic_string.h (basic_string::at): Move adjacent to other
...
...
libstdc++-v3/include/backward/hashtable.h
View file @
b9b8c6ae
...
...
@@ -209,7 +209,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Note: assumes long is at least 32 bits.
enum
{
_S_num_primes
=
29
};
static
const
unsigned
long
__stl_prime_list
[
_S_num_primes
]
=
template
<
typename
_PrimeType
>
struct
_Hashtable_prime_list
{
static
const
_PrimeType
__stl_prime_list
[
_S_num_primes
];
static
const
_PrimeType
*
_S_get_prime_list
();
};
template
<
typename
_PrimeType
>
const
_PrimeType
_Hashtable_prime_list
<
_PrimeType
>::
__stl_prime_list
[
_S_num_primes
]
=
{
5ul
,
53ul
,
97ul
,
193ul
,
389ul
,
769ul
,
1543ul
,
3079ul
,
6151ul
,
12289ul
,
...
...
@@ -219,11 +229,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
805306457ul
,
1610612741ul
,
3221225473ul
,
4294967291ul
};
template
<
class
_PrimeType
>
inline
const
_PrimeType
*
_Hashtable_prime_list
<
_PrimeType
>::
_S_get_prime_list
()
{
return
__stl_prime_list
;
}
inline
unsigned
long
__stl_next_prime
(
unsigned
long
__n
)
{
const
unsigned
long
*
__first
=
_
_stl_prime_list
;
const
unsigned
long
*
__last
=
__
stl_prime_li
st
+
(
int
)
_S_num_primes
;
const
unsigned
long
*
__first
=
_
Hashtable_prime_list
<
unsigned
long
>::
_S_get_prime_list
()
;
const
unsigned
long
*
__last
=
__
fir
st
+
(
int
)
_S_num_primes
;
const
unsigned
long
*
pos
=
std
::
lower_bound
(
__first
,
__last
,
__n
);
return
pos
==
__last
?
*
(
__last
-
1
)
:
*
pos
;
}
...
...
@@ -417,7 +433,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
size_type
max_bucket_count
()
const
{
return
__stl_prime_list
[(
int
)
_S_num_primes
-
1
];
}
{
return
_Hashtable_prime_list
<
unsigned
long
>::
_S_get_prime_list
()[(
int
)
_S_num_primes
-
1
];
}
size_type
elems_in_bucket
(
size_type
__bucket
)
const
...
...
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