Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netrunner
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Odilitime
netrunner
Commits
acf2d7a4
Commit
acf2d7a4
authored
7 years ago
by
despair
Browse files
Options
Downloads
Patches
Plain Diff
moved all local types, allocators, and functors to `namespace ntr`
parent
0e032244
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/CFGFileParser.h
+7
-5
7 additions, 5 deletions
src/CFGFileParser.h
with
7 additions
and
5 deletions
src/CFGFileParser.h
+
7
−
5
View file @
acf2d7a4
...
...
@@ -12,15 +12,17 @@
#include
<cstdint>
// let's try fast strings
typedef
std
::
basic_string
<
char
,
std
::
char_traits
<
char
>
,
ntr
::
TLSFAlloc
<
char
>>
fast_string
;
namespace
ntr
{
size_t
string_hash
(
const
fast_string
&
str
);
bool
fast_string_compare
(
fast_string
t1
,
fast_string
t2
);
}
typedef
std
::
unordered_map
<
fast_string
,
fast_string
,
std
::
function
<
decltype
(
ntr
::
string_hash
)
>
,
std
::
function
<
decltype
(
ntr
::
fast_string_compare
)
>
,
ntr
::
TLSFAlloc
<
std
::
pair
<
const
fast_string
,
fast_string
>>>
stringmap
;
namespace
ntr
{
typedef
std
::
basic_string
<
char
,
std
::
char_traits
<
char
>
,
TLSFAlloc
<
char
>>
fast_string
;
size_t
string_hash
(
const
fast_string
&
str
);
bool
fast_string_compare
(
fast_string
t1
,
fast_string
t2
);
typedef
std
::
unordered_map
<
fast_string
,
fast_string
,
std
::
function
<
decltype
(
ntr
::
string_hash
)
>
,
std
::
function
<
decltype
(
ntr
::
fast_string_compare
)
>
,
ntr
::
TLSFAlloc
<
std
::
pair
<
const
fast_string
,
fast_string
>>>
stringmap
;
}
// Class which holds the parsed configuration options after
// being processed by CFGFileParser. No longer a "trivial class"
// just select by cfg->GlobalSettings....
struct
BrowserConfiguration
{
stringmap
GlobalSettings
;
ntr
::
stringmap
GlobalSettings
;
// fast allocation!
static
void
*
operator
new
(
std
::
size_t
n
){
if
(
void
*
mem
=
tlsf_malloc
(
n
)){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment