Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
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
Libraries
nghttp2
Commits
8ce8b2af
Commit
8ce8b2af
authored
Aug 15, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Remove unused Memchunk::shrink
parent
d1e49a19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
27 deletions
+1
-27
src/memchunk.h
src/memchunk.h
+1
-27
No files found.
src/memchunk.h
View file @
8ce8b2af
...
...
@@ -43,18 +43,13 @@ namespace nghttp2 {
template
<
size_t
N
>
struct
Memchunk
{
Memchunk
(
std
::
unique_ptr
<
Memchunk
>
next_chunk
)
:
pos
(
std
::
begin
(
buf
)),
last
(
pos
),
knext
(
std
::
move
(
next_chunk
)),
kprev
(
nullptr
),
next
(
nullptr
)
{
if
(
knext
)
{
knext
->
kprev
=
this
;
}
}
next
(
nullptr
)
{}
size_t
len
()
const
{
return
last
-
pos
;
}
size_t
left
()
const
{
return
std
::
end
(
buf
)
-
last
;
}
void
reset
()
{
pos
=
last
=
std
::
begin
(
buf
);
}
std
::
array
<
uint8_t
,
N
>
buf
;
uint8_t
*
pos
,
*
last
;
std
::
unique_ptr
<
Memchunk
>
knext
;
Memchunk
*
kprev
;
Memchunk
*
next
;
static
const
size_t
size
=
N
;
};
...
...
@@ -82,27 +77,6 @@ template <typename T> struct Pool {
}
freelist
=
m
;
}
void
shrink
(
size_t
max
)
{
auto
m
=
freelist
;
for
(;
m
&&
poolsize
>
max
;)
{
auto
next
=
m
->
next
;
poolsize
-=
T
::
size
;
auto
p
=
m
->
kprev
;
if
(
p
)
{
p
->
knext
=
std
::
move
(
m
->
knext
);
if
(
p
->
knext
)
{
p
->
knext
->
kprev
=
p
;
}
}
else
{
pool
=
std
::
move
(
m
->
knext
);
if
(
pool
)
{
pool
->
kprev
=
nullptr
;
}
}
m
=
next
;
}
freelist
=
m
;
}
void
clear
()
{
freelist
=
nullptr
;
pool
=
nullptr
;
...
...
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