Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
38c8d36e
Commit
38c8d36e
authored
Jul 16, 2018
by
zjbztianya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove extra semicolon
parent
33604cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
pooled_map.h
src/butil/containers/pooled_map.h
+10
-10
No files found.
src/butil/containers/pooled_map.h
View file @
38c8d36e
...
...
@@ -128,8 +128,8 @@ public:
void
swap
(
PooledAllocator
&
other
)
{
_pool
.
swap
(
other
.
_pool
);
}
// Convert references to pointers.
pointer
address
(
reference
r
)
const
{
return
&
r
;
}
;
const_pointer
address
(
const_reference
r
)
const
{
return
&
r
;
}
;
pointer
address
(
reference
r
)
const
{
return
&
r
;
}
const_pointer
address
(
const_reference
r
)
const
{
return
&
r
;
}
// Allocate storage for n values of T1.
pointer
allocate
(
size_type
n
,
PooledAllocator
<
void
,
0
>::
const_pointer
=
0
)
{
...
...
@@ -138,7 +138,7 @@ public:
}
else
{
return
(
pointer
)
malloc
(
n
*
sizeof
(
T1
));
}
}
;
}
// Deallocate storage obtained by a call to allocate.
void
deallocate
(
pointer
p
,
size_type
n
)
{
...
...
@@ -147,17 +147,17 @@ public:
}
else
{
free
(
p
);
}
}
;
}
// Return the largest possible storage available through a call to allocate.
size_type
max_size
()
const
{
return
0xFFFFFFFF
/
sizeof
(
T1
);
}
;
size_type
max_size
()
const
{
return
0xFFFFFFFF
/
sizeof
(
T1
);
}
void
construct
(
pointer
ptr
)
{
::
new
(
ptr
)
T1
;
}
;
void
construct
(
pointer
ptr
,
const
T1
&
val
)
{
::
new
(
ptr
)
T1
(
val
);
}
;
void
construct
(
pointer
ptr
)
{
::
new
(
ptr
)
T1
;
}
void
construct
(
pointer
ptr
,
const
T1
&
val
)
{
::
new
(
ptr
)
T1
(
val
);
}
template
<
class
U1
>
void
construct
(
pointer
ptr
,
const
U1
&
val
)
{
::
new
(
ptr
)
T1
(
val
);
}
void
destroy
(
pointer
p
)
{
p
->
T1
::~
T1
();
}
;
void
destroy
(
pointer
p
)
{
p
->
T1
::~
T1
();
}
private
:
butil
::
SingleThreadedPool
<
sizeof
(
T1
),
BLOCK_SIZE
,
1
>
_pool
;
...
...
@@ -167,10 +167,10 @@ private:
// and vice versa. It's clear that our allocator can't be exchanged.
template
<
typename
T1
,
size_t
S1
,
typename
T2
,
size_t
S2
>
bool
operator
==
(
const
PooledAllocator
<
T1
,
S1
>&
,
const
PooledAllocator
<
T2
,
S2
>&
)
{
return
false
;
}
;
{
return
false
;
}
template
<
typename
T1
,
size_t
S1
,
typename
T2
,
size_t
S2
>
bool
operator
!=
(
const
PooledAllocator
<
T1
,
S1
>&
a
,
const
PooledAllocator
<
T2
,
S2
>&
b
)
{
return
!
(
a
==
b
);
}
;
{
return
!
(
a
==
b
);
}
}
// namespace details
}
// namespace butil
...
...
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