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
3d85e0a0
Commit
3d85e0a0
authored
Aug 21, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor patches from svn
parent
22c662c8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
iobuf.cpp
src/base/iobuf.cpp
+3
-3
default_variables.cpp
src/bvar/default_variables.cpp
+3
-1
passive_status.h
src/bvar/passive_status.h
+0
-2
No files found.
src/base/iobuf.cpp
View file @
3d85e0a0
...
@@ -213,7 +213,7 @@ size_t IOBuf::new_bigview_count() {
...
@@ -213,7 +213,7 @@ size_t IOBuf::new_bigview_count() {
}
}
struct
IOBuf
::
Block
{
struct
IOBuf
::
Block
{
base
::
atomic
<
int
32_t
>
nshared
;
base
::
atomic
<
int
>
nshared
;
uint16_t
size
;
uint16_t
size
;
uint16_t
cap
;
uint16_t
cap
;
Block
*
portal_next
;
Block
*
portal_next
;
...
@@ -242,7 +242,7 @@ struct IOBuf::Block {
...
@@ -242,7 +242,7 @@ struct IOBuf::Block {
}
}
}
}
int
32_t
ref_count
()
const
{
int
ref_count
()
const
{
return
nshared
.
load
(
base
::
memory_order_relaxed
);
return
nshared
.
load
(
base
::
memory_order_relaxed
);
}
}
...
@@ -253,7 +253,7 @@ struct IOBuf::Block {
...
@@ -253,7 +253,7 @@ struct IOBuf::Block {
namespace
iobuf
{
namespace
iobuf
{
// for unit test
// for unit test
int
32_t
block_shared_count
(
IOBuf
::
Block
const
*
b
)
{
return
b
->
ref_count
();
}
int
block_shared_count
(
IOBuf
::
Block
const
*
b
)
{
return
b
->
ref_count
();
}
IOBuf
::
Block
*
get_portal_next
(
IOBuf
::
Block
const
*
b
)
{
IOBuf
::
Block
*
get_portal_next
(
IOBuf
::
Block
const
*
b
)
{
return
b
->
portal_next
;
return
b
->
portal_next
;
...
...
src/bvar/default_variables.cpp
View file @
3d85e0a0
...
@@ -245,7 +245,9 @@ static int get_fd_count(int limit) {
...
@@ -245,7 +245,9 @@ static int get_fd_count(int limit) {
for
(
base
::
FilePath
name
=
fd_enum
.
Next
();
for
(
base
::
FilePath
name
=
fd_enum
.
Next
();
!
name
.
empty
()
&&
count
<=
limit
;
!
name
.
empty
()
&&
count
<=
limit
;
name
=
fd_enum
.
Next
(),
++
count
)
{}
name
=
fd_enum
.
Next
(),
++
count
)
{}
return
count
-
2
/*. and ..*/
-
1
/*opendir itself*/
;
// FileEnumerator already filtered . and .., due to its implementation,
// the fd created by opendir is not counted as well.
return
count
;
}
}
extern
PassiveStatus
<
int
>
g_fd_num
;
extern
PassiveStatus
<
int
>
g_fd_num
;
...
...
src/bvar/passive_status.h
View file @
3d85e0a0
...
@@ -10,8 +10,6 @@
...
@@ -10,8 +10,6 @@
namespace
bvar
{
namespace
bvar
{
// TODO: naming should be consistent with Status<>
// Display a updated-by-need value. This is done by passing in an user callback
// Display a updated-by-need value. This is done by passing in an user callback
// which is called to produce the value.
// which is called to produce the value.
// Example:
// Example:
...
...
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